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

James E. King, III commented on THRIFT-4223:
--------------------------------------------

I've never had a need to ask the server if it is running or not in C++.  
TServer::serve() does not return until it is done serving.  There should be no 
race conditions.  Can you elaborate on "race conditions between the server and 
the client" a bit more?  If you are looking for a barrier on which you can 
inform the rest of your application that thrift is listening on the server 
port, you can give your TServer a TServerEventHandler implementation that 
overrides TServerEventHandler::preServe().  This notification can be used to 
learn when the server is accepting connections (listening) on the server 
socket, to coordinate tests or other parts of your application.

> Add support to the isServing() method for the C++ library
> ---------------------------------------------------------
>
>                 Key: THRIFT-4223
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4223
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.10.0
>         Environment: Linux
>            Reporter: Erick Arroyo
>             Fix For: 0.11.0
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> It is important to add support to the isServing() method for the C++ library 
> and in the other supported languages. This method is already exposed on the 
> Java library. 
> This method is very useful to determine when exactly the server is in 
> listening state and also can be used to fix for example race conditions 
> between the server and the client.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to