OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 RawServerSocket { | 5 patch class RawServerSocket { |
6 /* patch */ static Future<RawServerSocket> bind(address, | 6 /* patch */ static Future<RawServerSocket> bind(address, |
7 int port, | 7 int port, |
8 {int backlog: 0, | 8 {int backlog: 0, |
9 bool v6Only: false}) { | 9 bool v6Only: false}) { |
10 return _RawServerSocket.bind(address, port, backlog, v6Only); | 10 return _RawServerSocket.bind(address, port, backlog, v6Only); |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 } else { | 838 } else { |
839 sendToEventHandler(1 << SHUTDOWN_READ_COMMAND); | 839 sendToEventHandler(1 << SHUTDOWN_READ_COMMAND); |
840 } | 840 } |
841 isClosedRead = true; | 841 isClosedRead = true; |
842 } | 842 } |
843 } | 843 } |
844 | 844 |
845 void sendToEventHandler(int data) { | 845 void sendToEventHandler(int data) { |
846 assert(!isClosing); | 846 assert(!isClosing); |
847 connectToEventHandler(); | 847 connectToEventHandler(); |
848 _EventHandler._sendData(this, eventPort, data); | 848 _EventHandler._sendData(this, eventPort.sendPort, data); |
849 } | 849 } |
850 | 850 |
851 void connectToEventHandler() { | 851 void connectToEventHandler() { |
852 assert(!isClosed); | 852 assert(!isClosed); |
853 if (eventPort == null) { | 853 if (eventPort == null) { |
854 eventPort = new RawReceivePort(multiplex); | 854 eventPort = new RawReceivePort(multiplex); |
855 _sockets[_serviceId] = this; | 855 _sockets[_serviceId] = this; |
856 } | 856 } |
857 } | 857 } |
858 | 858 |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 String address, | 1902 String address, |
1903 List<int> in_addr, | 1903 List<int> in_addr, |
1904 int port) { | 1904 int port) { |
1905 return new Datagram( | 1905 return new Datagram( |
1906 data, | 1906 data, |
1907 new _InternetAddress(address, null, in_addr), | 1907 new _InternetAddress(address, null, in_addr), |
1908 port); | 1908 port); |
1909 } | 1909 } |
1910 | 1910 |
1911 String _socketsStats() => _SocketsObservatory.toJSON(); | 1911 String _socketsStats() => _SocketsObservatory.toJSON(); |
OLD | NEW |