diff --git a/socket.vp b/socket.vp index e8dccdc..77487dc 100644 --- a/socket.vp +++ b/socket.vp @@ -212,7 +212,7 @@ class Socket: if platmacro.IS_WINDOWS: self.fd = INT(win32.winsock2.socket(family, type, protocol)) else: - self.fd = socket(family, type, protocol) + self.fd = INT(socket(family, type, protocol)) def connect(self, host: str, port: INT) -> INT: """Connect to remote host. @@ -334,7 +334,7 @@ class Socket: out_client.protocol = self.protocol return INT(client_fd) - client_fd: INT = accept(self.fd, &addr, &addrlen) + client_fd: INT = INT(accept(self.fd, &addr, &addrlen)) if client_fd == SOCKET_ERROR: return SOCKET_ERROR out_client.fd = client_fd @@ -407,7 +407,7 @@ def SocketCreate(family: INT, type: INT, protocol: INT, out_sock: Socket*) -> IN out_sock.fd = INT(fd) if fd == win32.winsock2.INVALID_SOCKET: return -1 else: - fd: INT = socket(family, type, protocol) + fd: INT = INT(socket(family, type, protocol)) out_sock.fd = fd if fd == INVALID_SOCKET: return -1 return 0