626,242 results for 'socket repo:jaraco/cpython-pcbuild' (53 ms)
inet.erl https://github.com/bsmr-erlang/otp.git | Erlang | 1,832 lines
78 local_address/0, socket_address/0, returned_non_ip_address/0, 79 socket_setopt/0, socket_getopt/0, ancillary_data/0, 80 posix/0, socket/0, stat_option/0]). 220 221-spec peernames(Socket :: socket()) -> 222 {ok, 589 590-spec getll(Socket :: socket()) -> {'ok', socket()}. 591 591 592getll(Socket) when is_port(Socket) -> 593 {ok, Socket}. 598 599-spec getfd(Socket :: socket()) -> 600 {'ok', non_neg_integer()} | {'error', posix()}.inet.xml https://github.com/bsmr-erlang/otp.git | XML | 1,703 lines
286 and 287 <seealso marker="gen_udp#type-socket"><c>gen_udp:type-socket</c></seealso>. 288 </p> 767 <p>This function can return multiple addresses for multihomed 768 sockets, such as SCTP sockets. For other sockets it 769 returns a one-element list.</p> 1069 busy message queue or a busy socket are resumed 1070 when the socket message queue and the socket are not busy.</p> 1071 <p>For more information, see options <c>high_watermark</c>, 1541 <p>This function can return multiple addresses for multihomed 1542 sockets, such as SCTP sockets. For other sockets it 1543 returns a one-element list.</p> 1544 <p>Notice that parameter <c><anno>Assoc</anno></c> is by the 1545 <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">SCTP Sockets API Extensions</url> 1546 defined to be ignored for one-to-one style sockets.http_transport.erl https://github.com/bsmr-erlang/otp.git | Erlang | 490 lines
190%%------------------------------------------------------------------------- 191%% accept(SocketType, ListenSocket) -> {ok, Socket} | {error, Reason} 192%% accept(SocketType, ListenSocket, Timeout) -> ok | {error, Reason} 217%%------------------------------------------------------------------------- 218%% controlling_process(SocketType, Socket, NewOwner) -> ok | {error, Reason} 219%% SocketType = ip_comm | {ssl, _} 297%%------------------------------------------------------------------------- 298%% getstat(SocketType, Socket) -> socket_stats() 299%% SocketType = ip_comm | {ssl, _} 359%%------------------------------------------------------------------------- 360%% peername(SocketType, Socket) -> {Port, SockName} 361%% SocketType = ip_comm | {ssl, _} 361%% SocketType = ip_comm | {ssl, _} 362%% Socket = socket() 363%% Port = integer() (-1 if error occured)jdwp.lua https://github.com/prakashgamit/nmap.git | Lua | 1,096 lines
188--@param port Port to connect to. 189--@return (status,socket) If status is false, socket is error message, otherwise socket is 190-- a newly created socket with initial handshake finished. 402-- 403--@param socket Socket to use to send the command. 404--@param id Packet id. 872-- 873--@param socket Socket to use to send the command. 874--@param id Packet id. 895-- 896-- @param socket Socket to use for communication. 897-- @param class ID of the class whose method we seek. 927-- 928-- @param socket Socket to use for communication. 929-- @param class_bytes String of bytes of a java class file to inject.ws_SUITE.erl https://github.com/bsmr-erlang/cowboy.git | Erlang | 544 lines
126 "Origin: http://localhost\r\n" 127 "Sec-Websocket-Key1: Y\" 4 1Lj!957b8@0H756!i\r\n" 128 "Sec-Websocket-Key2: 1711 M;4\\74 80<6\r\n" 129 "\r\n"), 130 {ok, Handshake} = gen_tcp:recv(Socket, 0, 6000), 131 {ok, {http_response, {1, 1}, 400, _}, _} = erlang:decode_packet(http, Handshake, []), 156 {ok, Socket} = gen_tcp:connect("localhost", config(port, Config), [binary, {active, false}]), 157 ok = gen_tcp:send(Socket, [ 158 "GET /ws_echo_timer HTTP/1.1\r\n" 191 %% Frames sent on timer by the handler. 192 {ok, << 1:1, 0:3, 1:4, 0:1, 14:7, "websocket_init" >>} = gen_tcp:recv(Socket, 0, 6000), 193 {ok, << 1:1, 0:3, 1:4, 0:1, 16:7, "websocket_handle" >>} = gen_tcp:recv(Socket, 0, 6000), 193 {ok, << 1:1, 0:3, 1:4, 0:1, 16:7, "websocket_handle" >>} = gen_tcp:recv(Socket, 0, 6000), 194 {ok, << 1:1, 0:3, 1:4, 0:1, 16:7, "websocket_handle" >>} = gen_tcp:recv(Socket, 0, 6000), 195 {ok, << 1:1, 0:3, 1:4, 0:1, 16:7, "websocket_handle" >>} = gen_tcp:recv(Socket, 0, 6000),inet.erl https://github.com/cobusc/otp.git | Erlang | 1,793 lines
78 local_address/0, socket_address/0, returned_non_ip_address/0, 79 socket_setopt/0, socket_getopt/0, 80 posix/0, socket/0, stat_option/0]). 208 209-spec peernames(Socket :: socket()) -> 210 {ok, 554 555-spec getll(Socket :: socket()) -> {'ok', socket()}. 556 556 557getll(Socket) when is_port(Socket) -> 558 {ok, Socket}. 563 564-spec getfd(Socket :: socket()) -> 565 {'ok', non_neg_integer()} | {'error', posix()}.inet.xml https://github.com/cobusc/otp.git | XML | 1,439 lines
640 <p>This function can return multiple addresses for multihomed 641 sockets, such as SCTP sockets. For other sockets it 642 returns a one-element list.</p> 902 busy message queue or a busy socket are resumed 903 when the socket message queue and the socket 904 are not busy.</p> 920 busy message queue or a busy socket are resumed 921 when the socket message queue and the socket are not busy.</p> 922 <p>For more information, see options <c>high_watermark</c>, 1277 <p>This function can return multiple addresses for multihomed 1278 sockets, such as SCTP sockets. For other sockets it 1279 returns a one-element list.</p> 1280 <p>Notice that parameter <c><anno>Assoc</anno></c> is by the 1281 <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">SCTP Sockets API Extensions</url> 1282 defined to be ignored for one-to-one style sockets.zsockopt.d git://github.com/1100110/CZMQ.git | D | 161 lines
38 /// Get socket options 39 int zsocket_hwm(void* socket); 40 int zsocket_swap (void* socket); 40 int zsocket_swap (void* socket); 41 int zsocket_affinity (void* socket); 42 int zsocket_rate (void* socket); 42 int zsocket_rate (void* socket); 43 int zsocket_recovery_ivl (void* socket); 44 int zsocket_recovery_ivl_msec (void* socket); 63 void zsocket_set_recovery_ivl (void* socket, int recovery_ivl); 64 void zsocket_set_recovery_ivl_msec (void* socket, int recovery_ivl_msec); 65 void zsocket_set_mcast_loop (void* socket, int mcast_loop); 153 /// Emulation of widely-used 2.x socket options 154 void zsocket_set_hwm (void* socket, int hwm); 155}srfi-basic-socket-interface.texi git://github.com/marcomaggi/vicare.git | Unknown | 742 lines
106message-type shutdown-method 107socket-merge-flags socket-purge-flags 108@end example 695 696(srfi.socket-send client-socket (string->utf8 "hello\r\n")) 697(display (utf8->string 697(display (utf8->string 698 (srfi.socket-recv client-socket 699 (string-length "hello\r\n")))) 700(flush-output-port (current-output-port)) 701(srfi.socket-shutdown client-socket 702 (srfi.shutdown-method read write)) 702 (srfi.shutdown-method read write)) 703(srfi.socket-close client-socket) 704@end examplesocket.idl.json git://github.com/facebook/hiphop-php.git | Unknown | 748 lines
294 "name": "socket_listen", 295 "desc": "After the socket socket has been created using socket_create() and bound to a name with socket_bind(), it may be told to listen for incoming connections on socket.\n\nsocket_listen() is applicable only to sockets of type SOCK_STREAM or SOCK_SEQPACKET.", 296 "flags": [ 317 "name": "socket_select", 318 "desc": "socket_select() accepts arrays of sockets and waits for them to change status. Those coming with BSD sockets background will recognize that those socket resource arrays are in fact the so-called file descriptor sets. Three independent arrays of socket resources are watched.\nWarning\n\nOn exit, the arrays are modified to indicate which socket resource actually changed status.\n\nYou do not need to pass every array to socket_select(). You can leave it out and use an empty array or NULL instead. Also do not forget that those arrays are passed by reference and will be modified after socket_select() returns.\n\nDue a limitation in the current Zend Engine it is not possible to pass a constant modifier like NULL directly as a parameter to a function which expects this parameter to be passed by reference. Instead use a temporary variable or an expression with the leftmost member being a temporary variable: Example #1 Using NULL with socket_select()", 319 "flags": [ 388 "name": "socket_accept", 389 "desc": "After the socket socket has been created using socket_create(), bound to a name with socket_bind(), and told to listen for connections with socket_listen(), this function will accept incoming connections on that socket. Once a successful connection is made, a new socket resource is returned, which may be used for communication. If there are multiple connections queued on the socket, the first will be used. If there are no pending connections, socket_accept() will block until a connection becomes present. If socket has been made non-blocking using socket_set_blocking() or socket_set_nonblock(), FALSE will be returned.\n\nThe socket resource returned by socket_accept() may not be used to accept new connections. The original listening socket socket, however, remains open and may be reused.", 390 "flags": [ 568 "name": "socket_recvfrom", 569 "desc": "The socket_recvfrom() function receives len bytes of data in buf from name on port port (if the socket is not of type AF_UNIX) using socket. socket_recvfrom() can be used to gather data from both connected and unconnected sockets. Additionally, one or more flags can be specified to modify the behaviour of the function.\n\nThe name and port must be passed by reference. If the socket is not connection-oriented, name will be set to the internet protocol address of the remote host or the path to the UNIX socket. If the socket is connection-oriented, name is NULL. Additionally, the port will contain the port of the remote host in the case of an unconnected AF_INET or AF_INET6 socket.", 570 "flags": [ 671 "name": "socket_last_error", 672 "desc": "If a socket resource is passed to this function, the last error which occurred on this particular socket is returned. If the socket resource is omitted, the error code of the last failed socket function is returned. The latter is particularly helpful for functions like socket_create() which don't return a socket on failure and socket_select() which can fail for reasons not directly tied to a particular socket. The error code is suitable to be fed to socket_strerror() which returns a string describing the given error code.", 673 "flags": [ext_socket.cpp git://github.com/facebook/hiphop-php.git | C++ | 1,268 lines
464bool f_socket_set_block(CResRef socket) { 465 Socket *sock = socket.getTyped<Socket>(); 466 return sock->setBlocking(true); 469bool f_socket_set_nonblock(CResRef socket) { 470 Socket *sock = socket.getTyped<Socket>(); 471 return sock->setBlocking(false); 475 CVarRef optval) { 476 Socket *sock = socket.getTyped<Socket>(); 477 794Variant f_socket_send(CResRef socket, const String& buf, int len, int flags) { 795 Socket *sock = socket.getTyped<Socket>(); 796 if (len > buf.size()) { 1033 if (!socket.isNull()) { 1034 Socket *sock = socket.getTyped<Socket>(); 1035 sock->setError(0);test_socket.py https://bitbucket.org/bluehorn/sampling_prof | Python | 5,574 lines
169 def setUp(self): 170 self.s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) 171 self.addCleanup(self.s.close) 1525 def testBindAny(self): 1526 with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: 1527 s.bind(('', )) 1530 # most systems limit IFNAMSIZ to 16, take 1024 to be sure 1531 with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: 1532 self.assertRaisesRegex(OSError, 'interface name too long', 1537 def testLoopback(self): 1538 with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: 1539 for loopback in (0, 1): 1549 can_filter = struct.pack("=II", can_id, can_mask) 1550 with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: 1551 s.setsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, can_filter)socket.rst https://bitbucket.org/bluehorn/sampling_prof | Unknown | 1,731 lines
1542 PORT = 50007 # The same port as used by the server 1543 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: 1544 s.connect((HOST, PORT)) 1631 # create a raw socket and bind it to the public interface 1632 s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) 1633 s.bind((HOST, 0)) 1650 1651 socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM) 1652 1678 # create a raw socket and bind it to the 'vcan0' interface 1679 s = socket.socket(socket.AF_CAN, socket.SOCK_RAW, socket.CAN_RAW) 1680 s.bind(('vcan0',)) 1707 1708 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 1709 s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)test_ssl.py https://bitbucket.org/python_mirrors/sandbox-guido | Python | 1,612 lines
437 # this should fail because we have no verification certs 438 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 439 cert_reqs=ssl.CERT_REQUIRED) 541 ctx.load_verify_locations(capath=CAPATH) 542 s = ctx.wrap_socket(socket.socket(socket.AF_INET)) 543 s.connect(("svn.python.org", 443)) 629 with support.transient_internet(remote[0]): 630 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 631 cert_reqs=ssl.CERT_NONE, ciphers="ALL") 632 s.connect(remote) 633 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 634 cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT") 652 with support.transient_internet("sha256.tbs-internet.com"): 653 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 654 cert_reqs=ssl.CERT_REQUIRED,test_socket.py https://bitbucket.org/python_mirrors/sandbox-guido | Python | 2,057 lines
578 # We know a socket should start without reuse==0 579 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 580 self.addCleanup(sock.close) 585 # Testing setsockopt() 586 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 587 self.addCleanup(sock.close) 875 # file descriptor 876 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, fileno=f) 877 self.addCleanup(sock.close) 1747 address = b"\x00python-test-hello\x00\xff" 1748 with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s1: 1749 s1.bind(address) 1750 s1.listen(1) 1751 with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s2: 1752 s2.connect(s1.getsockname())test_ssl.py https://bitbucket.org/christandiono/cpython | Python | 2,184 lines
387 def test_dealloc_warn(self): 388 ss = ssl.wrap_socket(socket.socket(socket.AF_INET)) 389 r = repr(ss) 695 # this should succeed because we specify the root cert 696 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 697 cert_reqs=ssl.CERT_REQUIRED, 777 ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) 778 s = ctx.wrap_socket(socket.socket(socket.AF_INET)) 779 s.connect(("svn.python.org", 443)) 842 with support.transient_internet("svn.python.org"): 843 ss = ssl.wrap_socket(socket.socket(socket.AF_INET)) 844 ss.connect(("svn.python.org", 443)) 910 s.connect(remote) 911 with ssl.wrap_socket(socket.socket(socket.AF_INET), 912 cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT") as s:test_socket.py https://bitbucket.org/christandiono/cpython | Python | 4,965 lines
47 try: 48 s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) 49 except (AttributeError, OSError): 154 def setUp(self): 155 self.s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) 156 self.addCleanup(self.s.close) 1365 def testLoopback(self): 1366 with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: 1367 for loopback in (0, 1): 1377 can_filter = struct.pack("=II", can_id, can_mask) 1378 with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: 1379 s.setsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, can_filter) 1446 def testBCM(self): 1447 bcm = socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM) 1448 self.addCleanup(bcm.close)socket.rst https://bitbucket.org/christandiono/cpython | Unknown | 1,431 lines
1222 PORT = 50007 # Arbitrary non-privileged port 1223 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 1224 s.bind((HOST, PORT)) 1240 PORT = 50007 # The same port as used by the server 1241 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 1242 s.connect((HOST, PORT)) 1330 # create a raw socket and bind it to the public interface 1331 s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) 1332 s.bind((HOST, 0)) 1349 1350 socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM) 1351 1377 # create a raw socket and bind it to the 'vcan0' interface 1378 s = socket.socket(socket.AF_CAN, socket.SOCK_RAW, socket.CAN_RAW) 1379 s.bind(('vcan0',))test_sock_app.py https://bitbucket.org/uiappstore/pypy | Python | 675 lines
346 import _socket 347 raises(_socket.error, _socket.socket, 10001, _socket.SOCK_STREAM, 0) 348 373 import _socket, os 374 s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM, 0) 375 # XXX temporarily we use python.org to test, will have more robust tests 470 intsize = struct.calcsize('i') 471 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 472 reusestr = s.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 644 MSG = 'dupa was here\n' 645 cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 646 cli.connect(self.serv.getsockname()) 657 import socket 658 cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 659 assert cli.family == socket.AF_INETtest_ssl.py https://bitbucket.org/uiappstore/pypy | Python | 1,361 lines
198 with test_support.transient_internet("svn.python.org"): 199 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 200 cert_reqs=ssl.CERT_NONE) 207 # this should fail because we have no verification certs 208 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 209 cert_reqs=ssl.CERT_REQUIRED) 217 # this should succeed because we specify the root cert 218 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 219 cert_reqs=ssl.CERT_REQUIRED, 275 with test_support.transient_internet("svn.python.org"): 276 ss = ssl.wrap_socket(socket.socket(socket.AF_INET)) 277 ss.connect(("svn.python.org", 443)) 344 with test_support.transient_internet("sha256.tbs-internet.com"): 345 s = ssl.wrap_socket(socket.socket(socket.AF_INET), 346 cert_reqs=ssl.CERT_REQUIRED,