Github user becrux commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/628#discussion_r45581352
  
    --- Diff: lib/cpp/src/thrift/server/TNonblockingServer.cpp ---
    @@ -1105,10 +1113,17 @@ void TNonblockingServer::listenSocket(THRIFT_SOCKET 
s) {
       serverSocket_ = s;
     
       if (!port_) {
    -    sockaddr_in addr;
    -    socklen_t size = sizeof(addr);
    -    if (!getsockname(serverSocket_, reinterpret_cast<sockaddr*>(&addr), 
&size)) {
    -      listenPort_ = ntohs(addr.sin_port);
    +    #ifdef _WIN32
    +      struct sockaddr_storage addr;
    +      struct sockaddr_in *pAddr = (sockaddr_in *) &addr;
    +      socklen_t size = sizeof(addr);
    +    #else
    +      struct sockaddr_in addr;
    +      struct sockaddr_in *pAddr = &addr;
    +      socklen_t size = sizeof(addr);
    +    #endif
    --- End diff --
    
    Yeah, that's fine for me.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to