!255 修改accept函数,以适应在_WIN32环境的tcp server

Merge pull request !255 from SenySunny/master
This commit is contained in:
李昂 2023-08-17 03:46:28 +00:00 committed by Gitee
commit 28c76c9ee7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -68,6 +68,9 @@ void _socket_socket__accept(PikaObj* self) {
__platform_printf("accept error\n");
return;
}
#ifdef _WIN32
pika_platform_init_winsock();
#endif
obj_setInt(self, "client_sockfd", client_sockfd);
obj_setStr(self, "client_addr", inet_ntoa(client_addr.sin_addr));
}