Chromium Code Reviews| Index: net/socket/tcp_socket_win.cc |
| diff --git a/net/socket/tcp_socket_win.cc b/net/socket/tcp_socket_win.cc |
| index 0d1192d359b30b7840162f13fff395e95e46ce7c..fc6d9d124871fcbb37e92c553016a17c2edcbf37 100644 |
| --- a/net/socket/tcp_socket_win.cc |
| +++ b/net/socket/tcp_socket_win.cc |
| @@ -339,6 +339,21 @@ int TCPSocketWin::Bind(const IPEndPoint& address) { |
| return OK; |
| } |
| +int TCPSocketWin::AdoptBoundSocket(SOCKET socket) { |
|
wtc
2014/04/24 23:09:31
I compared this method with AdoptConnectedSocket.
xiyuan
2014/04/25 20:29:29
|core_| is only used for read/write operations and
|
| + DCHECK(CalledOnValidThread()); |
| + DCHECK_EQ(socket_, INVALID_SOCKET); |
| + |
| + socket_ = socket; |
| + |
| + if (SetNonBlocking(socket_)) { |
| + int result = MapSystemError(WSAGetLastError()); |
| + Close(); |
| + return result; |
| + } |
| + |
| + return OK; |
| +} |
| + |
| int TCPSocketWin::Listen(int backlog) { |
| DCHECK(CalledOnValidThread()); |
| DCHECK_GT(backlog, 0); |