OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_SOCKET_TCP_SOCKET_WIN_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_WIN_H_ |
6 #define NET_SOCKET_TCP_SOCKET_WIN_H_ | 6 #define NET_SOCKET_TCP_SOCKET_WIN_H_ |
7 | 7 |
8 #include <winsock2.h> | 8 #include <winsock2.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 public base::win::ObjectWatcher::Delegate { | 28 public base::win::ObjectWatcher::Delegate { |
29 public: | 29 public: |
30 TCPSocketWin(NetLog* net_log, const NetLog::Source& source); | 30 TCPSocketWin(NetLog* net_log, const NetLog::Source& source); |
31 virtual ~TCPSocketWin(); | 31 virtual ~TCPSocketWin(); |
32 | 32 |
33 int Open(AddressFamily family); | 33 int Open(AddressFamily family); |
34 // Takes ownership of |socket|. | 34 // Takes ownership of |socket|. |
35 int AdoptConnectedSocket(SOCKET socket, const IPEndPoint& peer_address); | 35 int AdoptConnectedSocket(SOCKET socket, const IPEndPoint& peer_address); |
36 | 36 |
37 int Bind(const IPEndPoint& address); | 37 int Bind(const IPEndPoint& address); |
38 // Takes ownership of |socket|. | |
39 int AdoptBoundSocket(SOCKET socket); | |
wtc
2014/04/24 23:09:31
IMPORTANT: It would be better to list this method
xiyuan
2014/04/25 20:29:29
Renamed to AdoptListenSocket since the adopted |so
| |
38 | 40 |
39 int Listen(int backlog); | 41 int Listen(int backlog); |
40 int Accept(scoped_ptr<TCPSocketWin>* socket, | 42 int Accept(scoped_ptr<TCPSocketWin>* socket, |
41 IPEndPoint* address, | 43 IPEndPoint* address, |
42 const CompletionCallback& callback); | 44 const CompletionCallback& callback); |
43 | 45 |
44 int Connect(const IPEndPoint& address, const CompletionCallback& callback); | 46 int Connect(const IPEndPoint& address, const CompletionCallback& callback); |
45 bool IsConnected() const; | 47 bool IsConnected() const; |
46 bool IsConnectedAndIdle() const; | 48 bool IsConnectedAndIdle() const; |
47 | 49 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 | 143 |
142 BoundNetLog net_log_; | 144 BoundNetLog net_log_; |
143 | 145 |
144 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); | 146 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); |
145 }; | 147 }; |
146 | 148 |
147 } // namespace net | 149 } // namespace net |
148 | 150 |
149 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ | 151 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ |
150 | 152 |
OLD | NEW |