| Index: runtime/bin/sync_socket_win.cc
|
| diff --git a/runtime/bin/sync_socket_win.cc b/runtime/bin/sync_socket_win.cc
|
| index cea14f9c0a286b52b9cdcfd62ec2ecdaf3cd8152..2ba64635d3ac5bb5a8bb6f1942cbe62693f95a07 100644
|
| --- a/runtime/bin/sync_socket_win.cc
|
| +++ b/runtime/bin/sync_socket_win.cc
|
| @@ -17,14 +17,12 @@ bool SynchronousSocket::Initialize() {
|
| return SocketBase::Initialize();
|
| }
|
|
|
| -
|
| static intptr_t Create(const RawAddr& addr) {
|
| const intptr_t type = SOCK_STREAM;
|
| SOCKET s = WSASocket(addr.ss.ss_family, type, 0, NULL, 0, 0);
|
| return (s == INVALID_SOCKET) ? -1 : s;
|
| }
|
|
|
| -
|
| static intptr_t Connect(intptr_t fd, const RawAddr& addr) {
|
| SOCKET socket = static_cast<SOCKET>(fd);
|
| intptr_t result =
|
| @@ -32,13 +30,11 @@ static intptr_t Connect(intptr_t fd, const RawAddr& addr) {
|
| return (result == SOCKET_ERROR) ? -1 : socket;
|
| }
|
|
|
| -
|
| intptr_t SynchronousSocket::CreateConnect(const RawAddr& addr) {
|
| intptr_t fd = Create(addr);
|
| return (fd < 0) ? fd : Connect(fd, addr);
|
| }
|
|
|
| -
|
| intptr_t SynchronousSocket::Available(intptr_t fd) {
|
| SOCKET socket = static_cast<SOCKET>(fd);
|
| DWORD available;
|
| @@ -46,7 +42,6 @@ intptr_t SynchronousSocket::Available(intptr_t fd) {
|
| return (result == SOCKET_ERROR) ? -1 : static_cast<intptr_t>(available);
|
| }
|
|
|
| -
|
| intptr_t SynchronousSocket::GetPort(intptr_t fd) {
|
| SOCKET socket = static_cast<SOCKET>(fd);
|
| RawAddr raw;
|
| @@ -57,7 +52,6 @@ intptr_t SynchronousSocket::GetPort(intptr_t fd) {
|
| return SocketAddress::GetAddrPort(raw);
|
| }
|
|
|
| -
|
| SocketAddress* SynchronousSocket::GetRemotePeer(intptr_t fd, intptr_t* port) {
|
| SOCKET socket = static_cast<SOCKET>(fd);
|
| RawAddr raw;
|
| @@ -72,7 +66,6 @@ SocketAddress* SynchronousSocket::GetRemotePeer(intptr_t fd, intptr_t* port) {
|
| return new SocketAddress(&raw.addr);
|
| }
|
|
|
| -
|
| intptr_t SynchronousSocket::Read(intptr_t fd,
|
| void* buffer,
|
| intptr_t num_bytes) {
|
| @@ -80,7 +73,6 @@ intptr_t SynchronousSocket::Read(intptr_t fd,
|
| return recv(socket, reinterpret_cast<char*>(buffer), num_bytes, 0);
|
| }
|
|
|
| -
|
| intptr_t SynchronousSocket::Write(intptr_t fd,
|
| const void* buffer,
|
| intptr_t num_bytes) {
|
| @@ -88,19 +80,16 @@ intptr_t SynchronousSocket::Write(intptr_t fd,
|
| return send(socket, reinterpret_cast<const char*>(buffer), num_bytes, 0);
|
| }
|
|
|
| -
|
| void SynchronousSocket::ShutdownRead(intptr_t fd) {
|
| SOCKET socket = static_cast<SOCKET>(fd);
|
| shutdown(socket, SD_RECEIVE);
|
| }
|
|
|
| -
|
| void SynchronousSocket::ShutdownWrite(intptr_t fd) {
|
| SOCKET socket = static_cast<SOCKET>(fd);
|
| shutdown(socket, SD_SEND);
|
| }
|
|
|
| -
|
| void SynchronousSocket::Close(intptr_t fd) {
|
| SOCKET socket = static_cast<SOCKET>(fd);
|
| closesocket(socket);
|
|
|