OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 patch class ServerSocket { | 5 patch class ServerSocket { |
6 /* patch */ factory ServerSocket(String bindAddress, int port, int backlog) { | 6 /* patch */ factory ServerSocket(String bindAddress, int port, int backlog) { |
7 return new _ServerSocket(bindAddress, port, backlog); | 7 return new _ServerSocket(bindAddress, port, backlog); |
8 } | 8 } |
9 } | 9 } |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 _handlerMask == 0 && | 101 _handlerMask == 0 && |
102 _handler != null) { | 102 _handler != null) { |
103 _handler.close(); | 103 _handler.close(); |
104 _handler = null; | 104 _handler = null; |
105 } else { | 105 } else { |
106 _activateHandlers(); | 106 _activateHandlers(); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 OSError _getError() native "Socket_GetError"; | 110 OSError _getError() native "Socket_GetError"; |
111 | 111 |
112 int _getPort() native "Socket_GetPort"; | 112 int _getPort() native "Socket_GetPort"; |
113 | 113 |
114 void set onError(void callback(e)) { | 114 void set onError(void callback(e)) { |
115 _setHandler(_ERROR_EVENT, callback); | 115 _setHandler(_ERROR_EVENT, callback); |
116 } | 116 } |
117 | 117 |
118 void _activateHandlers() { | 118 void _activateHandlers() { |
119 if (_canActivateHandlers && !_closed) { | 119 if (_canActivateHandlers && !_closed) { |
120 if (_handlerMask == 0) { | 120 if (_handlerMask == 0) { |
121 if (_handler != null) { | 121 if (_handler != null) { |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 bool _seenFirstOutEvent = false; | 594 bool _seenFirstOutEvent = false; |
595 bool _pipe = false; | 595 bool _pipe = false; |
596 Function _clientConnectHandler; | 596 Function _clientConnectHandler; |
597 Function _clientWriteHandler; | 597 Function _clientWriteHandler; |
598 _SocketInputStream _inputStream; | 598 _SocketInputStream _inputStream; |
599 _SocketOutputStream _outputStream; | 599 _SocketOutputStream _outputStream; |
600 String _remoteHost; | 600 String _remoteHost; |
601 int _remotePort; | 601 int _remotePort; |
602 static SendPort _socketService; | 602 static SendPort _socketService; |
603 } | 603 } |
OLD | NEW |