Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
Fix 'bind' for Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
Flone-dnb committed Oct 20, 2020
1 parent 039f8ba commit 81360be
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Model/ServerService/serverservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,11 @@ void ServerService::startToListenForConnection()
myAddr .sin_port = htons( pSettingsManager ->getCurrentSettings() ->iPort );
myAddr .sin_addr.s_addr = INADDR_ANY;

#if _WIN32
int WSAAPI bind(_In_ SOCKET s,_In_reads_bytes_(namelen) const struct sockaddr FAR * name, _In_ int namelen);
#elif __linux__
int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
#endif

if (bind(listenTCPSocket, reinterpret_cast<sockaddr*>(&myAddr), static_cast<int>(sizeof(myAddr))) == SOCKET_ERROR)
{
Expand Down Expand Up @@ -1249,7 +1253,11 @@ void ServerService::prepareForVoiceConnection()



int WSAAPI bind(_In_ SOCKET s,_In_reads_bytes_(namelen) const struct sockaddr FAR * name, _In_ int namelen);
#if _WIN32
int WSAAPI bind(_In_ SOCKET s,_In_reads_bytes_(namelen) const struct sockaddr FAR * name, _In_ int namelen);
#elif __linux__
int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
#endif

if (bind(UDPsocket, reinterpret_cast<sockaddr*>(&myAddr), sizeof(myAddr)) == SOCKET_ERROR)
{
Expand Down

0 comments on commit 81360be

Please sign in to comment.