Alternative StreamServer

67 views
Skip to first unread message

yanis lisima

unread,
Dec 5, 2012, 7:52:04 AM12/5/12
to json...@googlegroups.com
Hy all.

While designing a jsonrpc server/client infrastructure, I have noticed that client socket connections stay in CLOSE_WAIT state even if the client has called close on the other end of the socket. Endeed some reseach on JAVA socket allow me to say in this case that the application have to close the socket on both sides explicitly: in a client/server architecture the client should tell the server when disconnecting. A half-way to slove this matter is to apply a Timeout beetween two client's messages: if the client does not send data in less than an amont of time the server close the connection. To do so I have made some changes in StreamServer.java in order to check data in the input stream with a timer.

Read the attached file for details.

My solution pass tests, but if you see some change to apply do not hesitate to tell me.

From now I will search for a way of creating a JsonRPC service for managing clients and allow client to disconnect and chage timout settings.
bye,


StreamServer.java

Brian

unread,
Jan 16, 2013, 11:39:16 AM1/16/13
to json...@googlegroups.com
please submit a patch and i'll integrate it.
Reply all
Reply to author
Forward
0 new messages