Changeset 39:897a32ccecc8 in vscpl for src
- Timestamp:
- 12/21/22 14:54:01 (2 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/hu/varadiistvan/scpl/io
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hu/varadiistvan/scpl/io/_posix/TCPServerSocket.cc
r33 r39 50 50 sin.sin_port = htons(port); 51 51 52 if (bind(reinterpret_cast<struct sockaddr*>(&sin), sizeof(sin) , false)<0) {52 if (bind(reinterpret_cast<struct sockaddr*>(&sin), sizeof(sin))<0) { 53 53 setErrorCode(errno); 54 54 return; -
src/hu/varadiistvan/scpl/io/_win32/TCPServerSocket.cc
r30 r39 50 50 sin.sin_port = htons(port); 51 51 52 int reuse = 1; 53 if (WSAInterface::get().setsockopt(handle, SOL_SOCKET, SO_REUSEADDR, 54 reinterpret_cast<const char*>(&reuse), 55 sizeof(reuse))<0) { 56 printf("TCPServerSocket: setsockopt(SO_REUSEADDR) failed\n"); 57 } 58 52 59 if (WSAInterface::get().bind(handle, 53 60 reinterpret_cast<struct sockaddr*>(&sin), sizeof(sin))<0) { -
src/hu/varadiistvan/scpl/io/_win32/WSAInterface.cc
r30 r39 83 83 //------------------------------------------------------------------------------ 84 84 85 int WSAInterface::setsockopt(HANDLE socket, int level, int optname, 86 const char* optval, int optlen) 87 { 88 return ::setsockopt(reinterpret_cast<SOCKET>(socket), level, optname, 89 optval, optlen); 90 } 91 92 //------------------------------------------------------------------------------ 93 85 94 int WSAInterface::bind(HANDLE socket, const struct sockaddr* name, int namelen) 86 95 { -
src/hu/varadiistvan/scpl/io/_win32/WSAInterface.h
r30 r39 86 86 87 87 /** 88 * Set a socket option 89 */ 90 int setsockopt(HANDLE socket, int level, int optname, 91 const char* optval, int optlen); 92 93 /** 88 94 * Bind the given socket handle to the given address. 89 95 */
Note:
See TracChangeset
for help on using the changeset viewer.