[ 
https://issues.apache.org/jira/browse/THRIFT-2696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133150#comment-14133150
 ] 

Severian Duchenko commented on THRIFT-2696:
-------------------------------------------

Jens, good day to you. Just found side effect of this fix.
If client do not send any data in specified timeout then connection terminates.
It is problem in "exit(0)". Processing of TTcpSocketStreamImpl.Read method 
assumes that connection is closed on error codes <= 0.
I am tried to find work around to fix this problem:
1. change result check conditions to correctly check for 0
2. after WaitForData = false, additionally check for connection state. Is 
doesn't helped.
3. handle socket events (OnError, OnDisconnect) and reset connection if needed. 
It doesn't helped too.
4. use assumption: if WaitForData(5000) = false then time of its execution is 
>= 5000ms. So i surrounded WaitForData with simple elapsed time check using 
GetTicksCount. It helped, but it is ugly.

My dev env: WinXP SP3 under VirtualBox, Delphi XE5.
I am using port forwarding to connect to application running in VirtualBox.

> Unable to stop socket server while there are idle clients
> ---------------------------------------------------------
>
>                 Key: THRIFT-2696
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2696
>             Project: Thrift
>          Issue Type: Bug
>          Components: Delphi - Library
>    Affects Versions: 0.9
>            Reporter: Severian Duchenko
>            Assignee: Jens Geyer
>         Attachments: 
> THRIFT-2696-Unable-to-stop-socket-server-while-there.patch, patch.txt
>
>
> When TSimpleServer created using TServerSocketImpl and there are idle clients 
> (connected, but not sending anything), it is impossible to stop server.
> After executing TSimpleServer.stop server will not stop until client is 
> disconnected or does not send anything.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to