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

Unified Diff: net/socket/server_socket.h

Issue 296053012: Replace StreamListenSocket with StreamSocket in HttpServer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't export HttpServer which is built in a static lib Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: net/socket/server_socket.h
diff --git a/net/socket/server_socket.h b/net/socket/server_socket.h
index 11151eea1539636928b64aee65876dfacd9e60ec..8729337275d8a52e419d000d225d4f9237df2b75 100644
--- a/net/socket/server_socket.h
+++ b/net/socket/server_socket.h
@@ -7,26 +7,34 @@
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
+#include "net/base/ip_endpoint.h"
#include "net/base/net_export.h"
namespace net {
-class IPEndPoint;
class StreamSocket;
class NET_EXPORT ServerSocket {
public:
- ServerSocket() { }
- virtual ~ServerSocket() { }
+ ServerSocket();
+ virtual ~ServerSocket();
- // Bind the socket and start listening. Destroy the socket to stop
+ // Binds the socket and start listening. Destroy the socket to stop
// listening.
virtual int Listen(const net::IPEndPoint& address, int backlog) = 0;
+ // Binds the socket with address and port, and start listening. It expects
+ // a vaild IPv4 or IPv6 address. Otherwise, it returns ERR_ADDRESS_INVALID.
+ // Subclasses may override this function if |ip_address| is not a valid IP
+ // address.
mmenke 2014/06/11 16:05:50 The last sentence is confusing - unclear what it's
byungchul 2014/06/20 08:22:32 Revised in the other CL, https://codereview.chromi
+ virtual int ListenWithAddressAndPort(const std::string& ip_address,
+ int port,
+ int backlog);
+
// Gets current address the socket is bound to.
virtual int GetLocalAddress(IPEndPoint* address) const = 0;
- // Accept connection. Callback is called when new connection is
+ // Accepts connection. Callback is called when new connection is
// accepted.
virtual int Accept(scoped_ptr<StreamSocket>* socket,
const CompletionCallback& callback) = 0;

Powered by Google App Engine
This is Rietveld 408576698