Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1010)

Side by Side Diff: runtime/bin/socket_patch.dart

Issue 2780063002: Pulled a significant portion of Socket implementation into BaseSocket in order to prepare for the s… (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 bool shared: false}) { 10 bool shared: false}) {
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 var interfaceAddr = multicastAddress(addr, interface); 1073 var interfaceAddr = multicastAddress(addr, interface);
1074 var interfaceIndex = interface == null ? 0 : interface.index; 1074 var interfaceIndex = interface == null ? 0 : interface.index;
1075 var result = nativeLeaveMulticast( 1075 var result = nativeLeaveMulticast(
1076 addr._in_addr, 1076 addr._in_addr,
1077 interfaceAddr == null ? null : interfaceAddr._in_addr, 1077 interfaceAddr == null ? null : interfaceAddr._in_addr,
1078 interfaceIndex); 1078 interfaceIndex);
1079 if (result is OSError) throw result; 1079 if (result is OSError) throw result;
1080 } 1080 }
1081 1081
1082 1082
1083 void nativeSetSocketId(int id) native "Socket_SetSocketId"; 1083 void nativeSetSocketId(int id) native "BaseSocket_SetSocketId";
1084 nativeAvailable() native "Socket_Available"; 1084 nativeAvailable() native "BaseSocket_Available";
1085 nativeRead(int len) native "Socket_Read"; 1085 nativeRead(int len) native "BaseSocket_Read";
1086 nativeRecvFrom() native "Socket_RecvFrom"; 1086 nativeRecvFrom() native "BaseSocket_RecvFrom";
1087 nativeWrite(List<int> buffer, int offset, int bytes) 1087 nativeWrite(List<int> buffer, int offset, int bytes)
1088 native "Socket_WriteList"; 1088 native "BaseSocket_WriteList";
1089 nativeSendTo(List<int> buffer, int offset, int bytes, 1089 nativeSendTo(List<int> buffer, int offset, int bytes,
1090 List<int> address, int port) 1090 List<int> address, int port)
1091 native "Socket_SendTo"; 1091 native "BaseSocket_SendTo";
1092 nativeCreateConnect(List<int> addr, 1092 nativeCreateConnect(List<int> addr,
1093 int port) native "Socket_CreateConnect"; 1093 int port) native "Socket_CreateConnect";
1094 nativeCreateBindConnect( 1094 nativeCreateBindConnect(
1095 List<int> addr, int port, List<int> sourceAddr) 1095 List<int> addr, int port, List<int> sourceAddr)
1096 native "Socket_CreateBindConnect"; 1096 native "Socket_CreateBindConnect";
1097 bool isBindError(int errorNumber) native "Socket_IsBindError"; 1097 bool isBindError(int errorNumber) native "BaseSocket_IsBindError";
1098 nativeCreateBindListen(List<int> addr, int port, int backlog, bool v6Only, 1098 nativeCreateBindListen(List<int> addr, int port, int backlog, bool v6Only,
1099 bool shared) 1099 bool shared)
1100 native "ServerSocket_CreateBindListen"; 1100 native "ServerSocket_CreateBindListen";
1101 nativeCreateBindDatagram(List<int> addr, int port, bool reuseAddress) 1101 nativeCreateBindDatagram(List<int> addr, int port, bool reuseAddress)
1102 native "Socket_CreateBindDatagram"; 1102 native "Socket_CreateBindDatagram";
1103 nativeAccept(_NativeSocket socket) native "ServerSocket_Accept"; 1103 nativeAccept(_NativeSocket socket) native "ServerSocket_Accept";
1104 int nativeGetPort() native "Socket_GetPort"; 1104 int nativeGetPort() native "BaseSocket_GetPort";
1105 List nativeGetRemotePeer() native "Socket_GetRemotePeer"; 1105 List nativeGetRemotePeer() native "BaseSocket_GetRemotePeer";
1106 int nativeGetSocketId() native "Socket_GetSocketId"; 1106 int nativeGetSocketId() native "BaseSocket_GetSocketId";
1107 OSError nativeGetError() native "Socket_GetError"; 1107 OSError nativeGetError() native "BaseSocket_GetError";
1108 nativeGetOption(int option, int protocol) native "Socket_GetOption"; 1108 nativeGetOption(int option, int protocol) native "BaseSocket_GetOption";
1109 bool nativeSetOption(int option, int protocol, value) 1109 bool nativeSetOption(int option, int protocol, value)
1110 native "Socket_SetOption"; 1110 native "BaseSocket_SetOption";
1111 OSError nativeJoinMulticast( 1111 OSError nativeJoinMulticast(
1112 List<int> addr, List<int> interfaceAddr, int interfaceIndex) 1112 List<int> addr, List<int> interfaceAddr, int interfaceIndex)
1113 native "Socket_JoinMulticast"; 1113 native "BaseSocket_JoinMulticast";
1114 bool nativeLeaveMulticast( 1114 bool nativeLeaveMulticast(
1115 List<int> addr, List<int> interfaceAddr, int interfaceIndex) 1115 List<int> addr, List<int> interfaceAddr, int interfaceIndex)
1116 native "Socket_LeaveMulticast"; 1116 native "BaseSocket_LeaveMulticast";
1117 } 1117 }
1118 1118
1119 1119
1120 class _RawServerSocket extends Stream<RawSocket> 1120 class _RawServerSocket extends Stream<RawSocket>
1121 implements RawServerSocket { 1121 implements RawServerSocket {
1122 final _NativeSocket _socket; 1122 final _NativeSocket _socket;
1123 StreamController<RawSocket> _controller; 1123 StreamController<RawSocket> _controller;
1124 ReceivePort _referencePort; 1124 ReceivePort _referencePort;
1125 bool _v6Only; 1125 bool _v6Only;
1126 1126
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 Datagram _makeDatagram(List<int> data, 1875 Datagram _makeDatagram(List<int> data,
1876 String address, 1876 String address,
1877 List<int> in_addr, 1877 List<int> in_addr,
1878 int port) { 1878 int port) {
1879 return new Datagram( 1879 return new Datagram(
1880 data, 1880 data,
1881 new _InternetAddress(address, null, in_addr), 1881 new _InternetAddress(address, null, in_addr),
1882 port); 1882 port);
1883 } 1883 }
1884 1884
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698