Use std.socket instead of vendor socket library.

Please use `if (bytesSent == Socket.ERROR) {` for keeping coding style.