- fixed bug in windows socket abstraction

pull/179/head
Michael Zillgith 7 years ago
parent 9ed1510223
commit 0421ea2101

@ -279,6 +279,8 @@ ServerSocket_accept(ServerSocket self)
conSocket = (Socket) GLOBAL_CALLOC(1, sizeof(struct sSocket));
conSocket->fd = fd;
socketCount++;
setSocketNonBlocking(conSocket);
}
@ -305,6 +307,9 @@ TcpSocket_create()
{
Socket self = NULL;
if (wsaStartUp() == false)
return NULL;
int sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock != INVALID_SOCKET) {
@ -405,9 +410,6 @@ Socket_connect(Socket self, const char* address, int port)
{
struct sockaddr_in serverAddress;
if (wsaStartUp() == false)
return false;
if (!prepareServerAddress(address, port, &serverAddress))
return false;

Loading…
Cancel
Save