You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Peace C (Created) (JIRA)" <ji...@apache.org> on 2011/11/21 21:20:53 UTC

[jira] [Created] (THRIFT-1433) TServerSocket fix for MSVC

TServerSocket fix for MSVC
--------------------------

                 Key: THRIFT-1433
                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Library
    Affects Versions: 0.8
         Environment: Windows Visual Studio 2010
            Reporter: Peace C
             Fix For: 0.8


The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
TSimpleServer::run() listen(): Could not listen: errno = 10022

The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function

It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:

inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
{
    return ::bind(socket, name, namelen);
}

The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Comment: was deleted

(was: Add alternate patch that uses ::bind for all platforms instead of #ifdef's for Windows vs Unix.

It would be great if this would be considered for inclusion in the 0.8 release. The Fix value is currently set for 0.9.)
    
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_alternate2.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158554#comment-13158554 ] 

Peace C edited comment on THRIFT-1433 at 11/28/11 9:54 PM:
-----------------------------------------------------------

Add alternate patch that uses ::bind for all platforms instead of #ifdef's for Windows vs Unix.

It would be great if this would be considered for inclusion in the 0.8 release. The Fix value is currently set for 0.9.
                
      was (Author: peace):
    Alternate patch that uses ::bind for all platforms instead of #ifdef
                  
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_alternate.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165689#comment-13165689 ] 

Hudson commented on THRIFT-1433:
--------------------------------

Integrated in Thrift #355 (See [https://builds.apache.org/job/Thrift/355/])
    THRIFT-1433 TServerSocket fix for MSVC
Patch: Peace C

roger : http://svn.apache.org/viewvc/?view=rev&rev=1212109
Files : 
* /thrift/trunk/lib/cpp/src/transport/TServerSocket.cpp
* /thrift/trunk/lib/cpp/src/windows/config.h

                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_12-8-2011.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Roger Meier (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier resolved THRIFT-1433.
---------------------------------

    Resolution: Fixed

I did not recognize... patch had wrong line endings (windows = CR+LF) instead of LF 

patch converted and committed
                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_12-8-2011.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Attachment: TServerSocket_bind.patch

TServerSocket patch for Visual Studio
                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.8
>
>         Attachments: TServerSocket_bind.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13154579#comment-13154579 ] 

Peace C commented on THRIFT-1433:
---------------------------------

Another thought --  if ::bind works under Unix-style OS's, we could forgo the #ifdef around that line. The net change could be as follows for all platforms:

(Old)
bind(serverSocket_, res->ai_addr, res->ai_addrlen)

(New)
::bind(serverSocket_, res->ai_addr, res->ai_addrlen)

                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.8
>
>         Attachments: TServerSocket_bind.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Attachment: TServerSocket_bind_12-8-2011.patch

Roger - Attached is an updated patch. Hope it works!

(TServerSocket patch uses ::bind for all platforms instead of #ifdef's for Windows vs Unix)
                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_12-8-2011.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Attachment:     (was: TServerSocket_bind_alternate2.patch)
    
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_12-8-2011.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Comment: was deleted

(was: Updated patch (removed the extraneous changes to TSimpleServer.cpp))
    
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_alternate2.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Attachment:     (was: TServerSocket_bind_alternate.patch)
    
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_alternate2.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165143#comment-13165143 ] 

Roger Meier commented on THRIFT-1433:
-------------------------------------

Thanks Peace

could you recreate the patch [^TServerSocket_bind_alternate2.patch] please, it does not apply anymore to trunk

{noformat}
git apply TServerSocket_bind_alternate2.patch
TServerSocket_bind_alternate2.patch:9: trailing whitespace.
      if (0 == ::bind(serverSocket_, (struct sockaddr *) &address, len)) {
TServerSocket_bind_alternate2.patch:14: trailing whitespace.
#else
TServerSocket_bind_alternate2.patch:15: trailing whitespace.
    GlobalOutput.perror("TSocket::open() Unix Domain socket path not supported on windows", -99);
TServerSocket_bind_alternate2.patch:16: trailing whitespace.
    throw TTransportException(TTransportException::NOT_OPEN, " Unix Domain socket path not supported");
TServerSocket_bind_alternate2.patch:17: trailing whitespace.
#endif
error: patch failed: lib/cpp/src/transport/TServerSocket.cpp:310
error: lib/cpp/src/transport/TServerSocket.cpp: patch does not apply
error: patch failed: lib/cpp/src/windows/config.h:72
error: lib/cpp/src/windows/config.h: patch does not apply
{noformat}

Thanks!
Roger


                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_alternate2.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13154474#comment-13154474 ] 

Peace C commented on THRIFT-1433:
---------------------------------

Correction: TThreadedServer is not yet included in the MSVC project.  TThreadPoolServer is supported and now works with this patch.
                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.8
>
>         Attachments: TServerSocket_bind.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Attachment: TServerSocket_bind_alternate.patch

Alternate patch that uses ::bind for all platforms instead of #ifdef
                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_alternate.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1433) TServerSocket fix for MSVC

Posted by "Peace C (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peace C updated THRIFT-1433:
----------------------------

    Attachment: TServerSocket_bind_alternate2.patch

Updated patch (removed the extraneous changes to TSimpleServer.cpp)
                
> TServerSocket fix for MSVC
> --------------------------
>
>                 Key: THRIFT-1433
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1433
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows Visual Studio 2010
>            Reporter: Peace C
>              Labels: TServerSocket,, bind,, socket,
>             Fix For: 0.9
>
>         Attachments: TServerSocket_bind.patch, TServerSocket_bind_alternate.patch, TServerSocket_bind_alternate2.patch
>
>
> The changes to compile the Thrift library for Visual Studio #ifdef'd out the bind section in TServerSocket.cpp. This prevented TSimpleServer, TThreadedServer and anything that uses TServerSocket transport from functioning.  The server side reports the following error due to 'bind' being skipped:
> TSimpleServer::run() listen(): Could not listen: errno = 10022
> The bind overload unfortunately results in a conflict with Microsoft's libraries. TServerSocket uses namespace std which pulls in the tr1 overloads of bind. The template definitions seem to always 'win' over any other overloads. I was unsuccessful creating an overload of bind in the windows config.h file so had to #ifdef the bind call. Microsoft is aware of the issue:
> http://connect.microsoft.com/VisualStudio/feedback/details/500364/how-to-avoid-conflicts-between-tr1-bind-and-winsock-bind-function
> It does the job though I'm not too proud of using #ifdefs. One possible way around this is to declare a wrapper function as such in config.h:
> inline int thriftbind(SOCKET socket, sockaddr* name, int namelen)
> {
>     return ::bind(socket, name, namelen);
> }
> The Unix-style version would need to be declared in the appropriate file as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira