/third_party/python/Lib/test/ |
H A D | test_socket.py | 10 import socket namespace 57 if not hasattr(socket, 'IOCTL_VM_SOCKETS_GET_LOCAL_CID'): 61 r = fcntl.ioctl(f, socket.IOCTL_VM_SOCKETS_GET_LOCAL_CID, " ") 70 s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) 80 s = socket.socket(socke 1272 self.skipTest('could not import needed symbols from socket') global() namespace 1362 self.skipTest('could not import needed symbols from socket') global() namespace [all...] |
H A D | test_smtpd.py | 6 import socket namespace 45 smtpd.socket = asyncore.socket = mock_socket 54 channel.socket.queue_recv(line) 74 asyncore.socket = smtpd.socket = socket 80 smtpd.socket = asyncore.socket = mock_socket 84 channel.socket [all...] |
H A D | test_timeout.py | 1 """Unit tests for socket timeout feature.""" 10 import socket namespace 21 return socket.getaddrinfo(host, port, socket.AF_INET, 22 socket.SOCK_STREAM)[0][4] 26 """Test case for socket.gettimeout() and socket.settimeout()""" 29 self.sock = socket.socket(socket [all...] |
/third_party/node/test/parallel/ |
H A D | test-http2-socket-proxy.js | 15 // Tests behavior of the proxied socket on Http2Session 27 const socket = stream.session.socket; 30 assert.ok(socket instanceof net.Socket); 32 assert.strictEqual(socket.writable, true); 33 assert.strictEqual(socket.readable, true); 34 assert.strictEqual(typeof socket.address(), 'object'); 36 socket.setTimeout(987); 55 assert.throws(() => socket.destroy, errMsg); 56 assert.throws(() => socket [all...] |
H A D | test-wrap-js-stream-destroy.js | 8 // This test ensures that when we directly call `socket.destroy()` without 9 // having called `socket.end()` on an instance of streamWrap, it will 10 // still emit EOF which makes the socket on the other side emit "end" and 14 const server = net.createServer((socket) => { 15 socket.on('error', common.mustNotCall()); 16 socket.on('end', common.mustNotCall()); 17 socket.on('close', common.mustCall()); 18 socket.destroy(); 28 const socket = new net.connect({ 31 socket [all...] |
H A D | test-http2-compat-socket.js | 14 // Tests behavior of the proxied socket in Http2ServerRequest 15 // & Http2ServerResponse - this proxy socket should mimic the 28 assert.ok(request.socket instanceof net.Socket); 29 assert.ok(response.socket instanceof net.Socket); 30 assert.strictEqual(request.socket, response.socket); 32 assert.ok(request.socket.readable); 34 assert.ok(request.socket.writable); 35 assert.strictEqual(request.socket.destroyed, false); 37 request.socket [all...] |
H A D | test-tls-client-reject.js | 36 const server = tls.createServer(options, function(socket) { 37 socket.pipe(socket); 39 socket.on('end', () => socket.end()); 46 const socket = tls.connect({ 52 assert(!socket.authorized); 53 socket.on('data', common.mustCall((data) => { 57 socket.on('end', common.mustCall(() => { 60 socket [all...] |
H A D | test-dgram-send-error.js | 13 const socket = dgram.createSocket('udp4'); 15 socket.on('message', common.mustNotCall('Should not receive any messages.')); 16 socket.bind(common.mustCall(() => { 17 socket[kStateSymbol].handle.lookup = function(address, callback) { 21 callback(socket); 23 return socket; 26 getSocket((socket) => { 27 socket.on('error', common.mustCall((err) => { 28 socket.close(); 32 socket [all...] |
H A D | test-dgram-socket-buffer-size.js | 18 'socket operation on non-socket' : 'bad file descriptor'; 22 'ENOTSOCK (socket operation on non-socket)' : 'EBADF (bad file descriptor)'; 38 // Should throw error if the socket is never bound. 41 const socket = dgram.createSocket('udp4'); 44 socket.setSendBufferSize(8192); 64 socket.getSendBufferSize(); 69 const socket = dgram.createSocket('udp4'); 71 // Should throw error if the socket i [all...] |
H A D | test-child-process-fork-net.js | 38 process.on('message', mustCall((m, socket) => { 39 if (!socket) return; 41 debug(`[${id}] got socket ${m}`); 44 socket[m](m); 46 socket.resume(); 48 socket.on('data', mustCallAtLeast(() => { 49 debug(`[${id}] socket.data ${m}`); 52 socket.on('end', mustCall(() => { 53 debug(`[${id}] socket.end ${m}`); 56 // Store the unfinished socket [all...] |
H A D | test-http-keep-alive-max-requests.js | 22 function writeRequest(socket, withBody) { 24 socket.write('POST / HTTP/1.1\r\n'); 25 socket.write('Connection: keep-alive\r\n'); 26 socket.write('Content-Type: text/plain\r\n'); 27 socket.write(`Content-Length: ${bodySent.length}\r\n\r\n`); 28 socket.write(`${bodySent}\r\n`); 29 socket.write('\r\n\r\n'); 31 socket.write('GET / HTTP/1.1\r\n'); 32 socket.write('Connection: keep-alive\r\n'); 33 socket [all...] |
H A D | test-net-pingpong.js | 38 function onSocket(socket) { 39 assert.strictEqual(socket.server, server); 47 socket.setNoDelay(); 48 socket.timeout = 0; 50 socket.setEncoding('utf8'); 51 socket.on('data', common.mustCall(function(data) { 55 assert.ok(socket.bufferSize >= 0 && socket.bufferSize <= 4); 57 assert.strictEqual(socket.writable, true); 58 assert.strictEqual(socket [all...] |
H A D | test-http-server-keep-alive-max-requests-null.js | 16 function writeRequest(socket) { 17 socket.write('POST / HTTP/1.1\r\n'); 18 socket.write('Connection: keep-alive\r\n'); 19 socket.write('Content-Type: text/plain\r\n'); 20 socket.write(`Content-Length: ${bodySent.length}\r\n\r\n`); 21 socket.write(`${bodySent}\r\n`); 22 socket.write('\r\n\r\n'); 44 const socket = new net.Socket(); 46 socket.on('end', common.mustCall(() => { 50 socket [all...] |
H A D | test-http-server-keep-alive-defaults.js | 16 function writeRequest(socket) { 17 socket.write('POST / HTTP/1.1\r\n'); 18 socket.write('Connection: keep-alive\r\n'); 19 socket.write('Content-Type: text/plain\r\n'); 20 socket.write(`Content-Length: ${bodySent.length}\r\n\r\n`); 21 socket.write(`${bodySent}\r\n`); 22 socket.write('\r\n\r\n'); 45 const socket = new net.Socket(); 47 socket.on('end', common.mustCall(() => { 51 socket [all...] |
H A D | test-https-agent-create-connection.js | 22 const checkRequest = (socket, server) => { 24 socket.on('connect', common.mustCall((data) => { 25 socket.write('GET / HTTP/1.1\r\n\r\n'); 26 socket.end(); 28 socket.on('data', common.mustCall((chunk) => { 31 socket.on('end', common.mustCall(() => { 57 const socket = agent.createConnection(options); 58 checkRequest(socket, server); 72 const socket = agent.createConnection(port, options); 73 checkRequest(socket, serve [all...] |
H A D | test-tls-server-parent-constructor-options.js | 20 const server = tls.createServer(options, common.mustCall((socket) => { 21 assert.strictEqual(socket.allowHalfOpen, false); 22 assert.strictEqual(socket.isPaused(), false); 29 const socket = tls.connect({ 33 socket.end(); 36 socket.on('close', () => { 47 }, common.mustCall((socket) => { 48 assert.strictEqual(socket.allowHalfOpen, true); 49 assert.strictEqual(socket.isPaused(), true); 50 socket [all...] |
H A D | test-net-socket-constructor.js | 17 let socket; 19 socket = sock; 21 socket = new net.Socket(sock); 22 socket.unref(); 25 assert.strictEqual(socket.readable, readable); 26 assert.strictEqual(socket.writable, writable); 32 const server = net.createServer(common.mustCall((socket) => { 33 socket.unref(); 34 test(socket, true, true); 35 test({ handle: socket [all...] |
/third_party/node/lib/ |
H A D | _http_client.js | 273 // there's never a case where this socket will actually be reused 348 const oncreate = once((err, socket) => { 352 this.onSocket(socket); 375 DTRACE_HTTP_CLIENT_REQUEST(this, this.socket); 430 this.socket?.destroy(err); 448 const socket = this; 449 const req = socket._httpMessage; 450 debug('HTTP socket close'); 454 const parser = socket.parser; 469 if (!req.socket [all...] |
H A D | _http_server.js | 188 constructor(type, socket) { 190 this.socket = socket; 232 DTRACE_HTTP_SERVER_RESPONSE(this.socket); 282 ServerResponse.prototype.assignSocket = function assignSocket(socket) { 283 if (socket._httpMessage) { 286 socket._httpMessage = this; 287 socket.on('close', onServerResponseClose); 288 this.socket = socket; [all...] |
H A D | _http_agent.js | 84 const socket = this; 85 debug('SOCKET ERROR on FREE socket:', err.message, err.stack); 86 socket.destroy(); 87 socket.emit('agentRemove'); 125 this.on('free', (socket, options) => { 129 // TODO(ronag): socket.destroy(err) might have been called 131 // case of socket.destroy() below this 'error' has no handler 134 if (!socket.writable) { 135 socket.destroy(); 146 asyncResetHandle(socket); [all...] |
/third_party/python/Tools/demo/ |
H A D | mcast.py | 21 import socket namespace 34 addrinfo = socket.getaddrinfo(group, None)[0] 36 s = socket.socket(addrinfo[0], socket.SOCK_DGRAM) 40 if addrinfo[0] == socket.AF_INET: # IPv4 41 s.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl_bin) 43 s.setsockopt(socket.IPPROTO_IPV6, socket [all...] |
/third_party/python/Lib/test/support/ |
H A D | socket_helper.py | 3 import socket namespace 18 def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM): 20 achieved by creating a temporary socket with the same family and type as 23 eliciting an unused ephemeral port from the OS. The temporary socket is 27 server socket needs to be bound to a particular port for the duration of 29 a python socket, or if an unused port needs to be provided in a constructor 33 socket is bound to a hard coded port, the ability to run multiple instances 42 the SO_REUSEADDR socket option having different semantics on Windows versus 46 the order bind and listen were called on each socket) [all...] |
/third_party/NuttX/include/nuttx/net/ |
H A D | net.h | 31 #include <sys/socket.h> 82 * socket descriptors 87 /* Capabilities of a socket */ 107 /* This defines a bitmap big enough for one bit for each socket option */ 119 /* This type defines the type of the socket capabilities set */ 123 /* This callbacks are socket operations that may be performed on a socket of 128 struct socket; /* Forward reference */ 133 CODE int (*si_setup)(FAR struct socket *psock, int protocol); 134 CODE sockcaps_t (*si_sockcaps)(FAR struct socket *psoc 186 struct socket global() struct [all...] |
/third_party/node/deps/undici/src/lib/ |
H A D | client.js | 344 const socket = this[kSocket] 346 (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) || 567 constructor (client, socket, { exports }) { 573 this.socket = socket 618 if (this.socket.destroyed || !this.paused) { 636 this.execute(this.socket [all...] |
/third_party/musl/libc-test/src/functionalext/supplement/network/ |
H A D | getsockopt_network.c | 16 #include <sys/socket.h> 35 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0100() 49 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0200() 63 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0300() 77 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0400() 91 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0500() 105 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0600() 119 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0700() 133 int sockfd = socket(AF_INET, SOCK_STREAM, 0); in getsockopt_0800() 147 int sockfd = socket(AF_INE in getsockopt_0900() [all...] |