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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 eventHandlers[ERROR_EVENT] = error; | 829 eventHandlers[ERROR_EVENT] = error; |
830 eventHandlers[CLOSED_EVENT] = closed; | 830 eventHandlers[CLOSED_EVENT] = closed; |
831 eventHandlers[DESTROYED_EVENT] = destroyed; | 831 eventHandlers[DESTROYED_EVENT] = destroyed; |
832 } | 832 } |
833 | 833 |
834 void setListening({read: true, write: true}) { | 834 void setListening({read: true, write: true}) { |
835 sendReadEvents = read; | 835 sendReadEvents = read; |
836 sendWriteEvents = write; | 836 sendWriteEvents = write; |
837 if (read) issueReadEvent(); | 837 if (read) issueReadEvent(); |
838 if (write) issueWriteEvent(); | 838 if (write) issueWriteEvent(); |
839 if (eventPort == null && !isClosing && !isClosed) { | 839 if (eventPort == null) { |
840 int flags = typeFlags & TYPE_TYPE_MASK; | 840 int flags = typeFlags & TYPE_TYPE_MASK; |
841 if (!isClosedRead) flags |= 1 << READ_EVENT; | 841 if (!isClosedRead) flags |= 1 << READ_EVENT; |
842 if (!isClosedWrite) flags |= 1 << WRITE_EVENT; | 842 if (!isClosedWrite) flags |= 1 << WRITE_EVENT; |
843 sendToEventHandler(flags); | 843 sendToEventHandler(flags); |
844 } | 844 } |
845 } | 845 } |
846 | 846 |
847 Future close() { | 847 Future close() { |
848 if (!isClosing && !isClosed) { | 848 if (!isClosing && !isClosed) { |
849 sendToEventHandler(1 << CLOSE_COMMAND); | 849 sendToEventHandler(1 << CLOSE_COMMAND); |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 String address, | 1754 String address, |
1755 List<int> in_addr, | 1755 List<int> in_addr, |
1756 int port) { | 1756 int port) { |
1757 return new Datagram( | 1757 return new Datagram( |
1758 data, | 1758 data, |
1759 new _InternetAddress(address, null, in_addr), | 1759 new _InternetAddress(address, null, in_addr), |
1760 port); | 1760 port); |
1761 } | 1761 } |
1762 | 1762 |
1763 String _socketsStats() => _SocketsObservatory.toJSON(); | 1763 String _socketsStats() => _SocketsObservatory.toJSON(); |
OLD | NEW |