[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Server closes connection to client just after accept()



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.