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

Severian Duchenko edited comment on THRIFT-2696 at 9/15/14 11:06 PM:
---------------------------------------------------------------------

Hi, Jens.
Your patch doesn't help.
I can solve it by debugging a lot of time and read MSDN documentation.
I found than Delphi's wrappers of WinSock do not follow api contract.
According to 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141(v=vs.85).aspx 
method "select" can return 0 when call is timed out, but Delphi's 
TCustomIpClient.Select process 0 (using method ErrorCheck) as socket error and 
returns False.
Also PeekBuf checks only for 1 byte available but not for "count". 
[#code_exmple.txt]


was (Author: severd):
Hi, Jens.
Your patch doesn't help.
I can solve it by debugging a lot of time and read MSDN documentation.
I found than Delphi's wrappers of WinSock do not follow api contract.
According to 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141(v=vs.85).aspx 
method "select" can return 0 when call is timed out, but Delphi's 
TCustomIpClient.Select process 0 (using method ErrorCheck) as socket error and 
returns False.
Also PeekBuf checks only for 1 byte available but not for "count". 

> 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, 
> THRIFT-2696-Unable-to-stop-socket-server-while-there_v2.patch, 
> code_exmple.txt, 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