Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: net/socket/tcp_listen_socket.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/tcp_client_socket_unittest.cc ('k') | net/socket/tcp_listen_socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_SOCKET_TCP_LISTEN_SOCKET_H_
6 #define NET_SOCKET_TCP_LISTEN_SOCKET_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "net/base/net_export.h"
12 #include "net/socket/socket_descriptor.h"
13 #include "net/socket/stream_listen_socket.h"
14
15 namespace net {
16
17 // Implements a TCP socket.
18 class NET_EXPORT TCPListenSocket : public StreamListenSocket {
19 public:
20 ~TCPListenSocket() override;
21 // Listen on port for the specified IP address. Use 127.0.0.1 to only
22 // accept local connections.
23 static scoped_ptr<TCPListenSocket> CreateAndListen(
24 const std::string& ip,
25 uint16 port,
26 StreamListenSocket::Delegate* del);
27
28 // Get raw TCP socket descriptor bound to ip:port.
29 static SocketDescriptor CreateAndBind(const std::string& ip, uint16 port);
30
31 // Get raw TCP socket descriptor bound to ip and return port it is bound to.
32 static SocketDescriptor CreateAndBindAnyPort(const std::string& ip,
33 uint16* port);
34
35 protected:
36 TCPListenSocket(SocketDescriptor s, StreamListenSocket::Delegate* del);
37
38 // Implements StreamListenSocket::Accept.
39 void Accept() override;
40
41 private:
42 DISALLOW_COPY_AND_ASSIGN(TCPListenSocket);
43 };
44
45 } // namespace net
46
47 #endif // NET_SOCKET_TCP_LISTEN_SOCKET_H_
OLDNEW
« no previous file with comments | « net/socket/tcp_client_socket_unittest.cc ('k') | net/socket/tcp_listen_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698