OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "net/base/tcp_listen_socket.h" | 5 #include "net/base/tcp_listen_socket.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 // winsock2.h must be included first in order to ensure it is included before | 8 // winsock2.h must be included first in order to ensure it is included before |
9 // windows.h. | 9 // windows.h. |
10 #include <winsock2.h> | 10 #include <winsock2.h> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 return; | 77 return; |
78 scoped_refptr<TCPListenSocket> sock( | 78 scoped_refptr<TCPListenSocket> sock( |
79 new TCPListenSocket(conn, socket_delegate_)); | 79 new TCPListenSocket(conn, socket_delegate_)); |
80 // It's up to the delegate to AddRef if it wants to keep it around. | 80 // It's up to the delegate to AddRef if it wants to keep it around. |
81 #if defined(OS_POSIX) | 81 #if defined(OS_POSIX) |
82 sock->WatchSocket(WAITING_READ); | 82 sock->WatchSocket(WAITING_READ); |
83 #endif | 83 #endif |
84 socket_delegate_->DidAccept(this, sock); | 84 socket_delegate_->DidAccept(this, sock); |
85 } | 85 } |
86 | 86 |
87 TCPListenSocketFactory::TCPListenSocketFactory(const string& ip, int port) : | |
88 ip_(ip), | |
89 port_(port) { | |
mmenke
2012/05/14 20:45:19
nit: Colon should go on next line, and should be
Philippe
2012/05/15 14:39:09
Done.
| |
90 } | |
91 | |
92 TCPListenSocketFactory::~TCPListenSocketFactory() {} | |
93 | |
94 scoped_refptr<StreamListenSocket> TCPListenSocketFactory::CreateAndListen( | |
95 StreamListenSocket::Delegate* delegate) { | |
96 return TCPListenSocket::CreateAndListen(ip_, port_, delegate); | |
97 } | |
98 | |
87 } // namespace net | 99 } // namespace net |
OLD | NEW |