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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 582 |
583 void sendToEventHandler(int data) { | 583 void sendToEventHandler(int data) { |
584 connectToEventHandler(); | 584 connectToEventHandler(); |
585 assert(!isClosed); | 585 assert(!isClosed); |
586 _EventHandler._sendData(this, eventPort, data); | 586 _EventHandler._sendData(this, eventPort, data); |
587 } | 587 } |
588 | 588 |
589 void connectToEventHandler() { | 589 void connectToEventHandler() { |
590 if (eventPort == null) { | 590 if (eventPort == null) { |
591 eventPort = new ReceivePort(); | 591 eventPort = new ReceivePort(); |
592 eventPort.receive ((var message, _) => multiplex(message)); | 592 eventPort.listen(multiplex); |
593 } | 593 } |
594 } | 594 } |
595 | 595 |
596 void disconnectFromEventHandler() { | 596 void disconnectFromEventHandler() { |
597 if (eventPort != null) { | 597 if (eventPort != null) { |
598 eventPort.close(); | 598 eventPort.close(); |
599 eventPort = null; | 599 eventPort = null; |
600 } | 600 } |
601 } | 601 } |
602 | 602 |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 if (_detachReady != null) { | 1215 if (_detachReady != null) { |
1216 _detachReady.complete(null); | 1216 _detachReady.complete(null); |
1217 } else { | 1217 } else { |
1218 if (_raw != null) { | 1218 if (_raw != null) { |
1219 _raw.shutdown(SocketDirection.SEND); | 1219 _raw.shutdown(SocketDirection.SEND); |
1220 _disableWriteEvent(); | 1220 _disableWriteEvent(); |
1221 } | 1221 } |
1222 } | 1222 } |
1223 } | 1223 } |
1224 } | 1224 } |
OLD | NEW |