[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Server closes connection to client just after accept()
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] Server closes connection to client just after accept()
- From: Anomit Ghosh <anomit.ghosh@xxxxxxxxx>
- Date: Thu, 13 May 2010 00:25:57 +0530
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Wed, 12 May 2010 14:56:05 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=wzzpXyDFxgBDj5WfVB22LTwRhqlWrTRZPggdl+J1u+8=; b=PL5/M+1QX6GP180FwjHVTNxceiHnvIWN1G0nxc9YXNt5r5WSMpEs06VU15V5YzxcSZ ls75qL48jsp22t9OM9GV92ePMXAkznSLgIX6u17H6nZCXk3VT73NXKr9yU6zmdgBlIVE PXqbYXMzciAwlDmEgcM6bHGZckW0lSNQsSacM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=wSU1ZpOZsHYiCw4CMQiobhxv5/84QozTqQ1Xgb9MzhBo872F9zGHfxqXzrOWYV6m3b Tbo4hsrSp+XeRftGLOB90f5CAw0xLU2DPprxQBrgnSQKi3GXMaEtdgIIMPa3VOu1+i2s dExwgZFa2Rc72pmk37g7hJP+sdzbgc1sRh/r8=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
This is the code in question: http://codepad.org/7eD9n14B
Run the code as `./server 127.0.0.1 <port number>`
I registered a callback(sock_callback) on the listening socket that
puts the new connections after accepting in a list. Now the problem
seems to be that even after doing event_add() in L73 the connection
closes immediately. I tested this by using telnet to connect to the
server. The printf() on L62 gets printed properly but nothing else
works properly. Where am I going wrong? Even a little help would be
appreciated (I'm kind of on a tight schedule :-| ).
Thanks
--
Anomit Ghosh
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.