PageRenderTime 3281ms queryFilters 0ms Sphinxql 504ms GetByIds 927ms meta 0ms repositoryFilters 1654ms languageFilters 1ms sourceFilters 0ms

4,451 results for 'socket' (3281 ms)

Source

Language

Repository

daemon.c https://gitlab.com/Exim/exim.git | C | 2,104 lines
129  listen_sockets        sockets which are listening for incoming calls
130  listen_socket_count   count of listening sockets
131  accept_socket         socket of the current accepted call
137static void
138handle_smtp_call(int *listen_sockets, int listen_socket_count,
139  int accept_socket, struct sockaddr *accepted)
423
424  for (i = 0; i < listen_socket_count; i++) (void)close(listen_sockets[i]);
425
1919      FD_SET(listen_sockets[sk], &select_listen);
1920      if (listen_sockets[sk] > max_socket) max_socket = listen_sockets[sk];
1921      }
2039          last_connection_time = time(NULL);
2040        handle_smtp_call(listen_sockets, listen_socket_count, accept_socket,
2041          (struct sockaddr *)&accepted);
ip.c https://gitlab.com/Exim/exim.git | C | 724 lines
7
8/* Functions for doing things with sockets. With the advent of IPv6 this has
9got messier, so that it's worth pulling out the code into separate functions
20
21/* Socket creation happens in a number of places so it's packaged here for
22convenience.
27
28Returns:     socket number or -1 on failure
29*/
166
167/* This function connects a socket to a remote address and port. The socket may
168or may not have previously been bound to a local interface. The socket is not
409return *spec == '/'
410  ? ip_unixsocket(spec, errstr) : ip_tcpsocket(spec, errstr, tmo);
411}
lhnet.c https://gitlab.com/xonotic/darkplaces.git | C | 1,437 lines
738		return;
739	lhnet_socketlist.next = lhnet_socketlist.prev = &lhnet_socketlist;
740	lhnet_packetlist.next = lhnet_packetlist.prev = &lhnet_packetlist;
927#else
928				if ((lhnetsocket->inetsocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) != -1)
929#endif
941#endif
942					if (ioctlsocket(lhnetsocket->inetsocket, FIONBIO, &_true) != -1)
943#endif
1025#ifdef WIN32
1026								if (ioctlsocket(lhnetsocket->inetsocket, SIO_UDP_CONNRESET, &_false) == -1)
1027									Con_DPrintf("LHNET_OpenSocket_Connectionless: ioctlsocket SIO_UDP_CONNRESET returned error: %s\n", LHNETPRIVATE_StrError());
1040						Con_Printf("LHNET_OpenSocket_Connectionless: ioctlsocket returned error: %s\n", LHNETPRIVATE_StrError());
1041					closesocket(lhnetsocket->inetsocket);
1042				}
net.c https://gitlab.com/xk/FreeTDS.git | C | 1,604 lines
337void
338tds_close_socket(TDSSOCKET * tds)
339{
1072	case WSAENOTSOCK: /* 10038 */
1073		return "WSAENOTSOCK: Socket operation on nonsocket.";
1074	case WSAEDESTADDRREQ: /* 10039 */
1189{
1190	TDSSOCKET *tds = (TDSSOCKET *) SSL_PTR;
1191	int have;
1224{
1225	TDSSOCKET *tds = (TDSSOCKET *) SSL_PTR;
1226
1430{
1431	TDSSOCKET *tds = (TDSSOCKET *) b->ptr;
1432
system.c https://gitlab.com/uDDRace/tCatch.git | C | 2,018 lines
64
65static NETSOCKET invalid_socket = {NETTYPE_INVALID, -1, -1};
66
834
835static int priv_net_close_all_sockets(NETSOCKET sock)
836{
906{
907	NETSOCKET sock = invalid_socket;
908	NETADDR tmpbindaddr = bindaddr;
1164
1165int net_tcp_accept(NETSOCKET sock, NETSOCKET *new_sock, NETADDR *a)
1166{
1500
1501int net_socket_read_wait(NETSOCKET sock, int time)
1502{
README.md https://gitlab.com/wincent/clipper.git | Markdown | 550 lines
365
366With this, a tmux process running on the remote host can use the same configuration file, and our `run-shell` from above will send the buffer contents to localhost:8377 (or the UNIX domain socket) on the remote machine, which will then be forwarded back over the SSH connection to localhost:8377 (or the UNIX domain socket) on the local machine, where Clipper is listening.
367
447
448Just as with TCP port forwarding, forwarding can fail when using UNIX domain sockets if a stale socket doesn't get automatically cleaned up (or overwritten, as should be the case when `StreamLocalBindUnlink yes` is present in the server's `sshd_config` file).
449
449
450In this case, the fix is to remove the stale socket on the remote host. For example, assuming a socket in `$HOME/.clipper.sock` on the remote host, `$HOST`:
451
465
466This may be fine on a single-user machine, but when you start using `ssh -R` to expose your Clipper instance on another machine you're evidently increasing your surface area. In order to mitigate this risk, you can configure Clipper to listen only on a UNIX domain socket, and place that socket in a location where the file-system permissions prevent others from accessing it.
467
467
468Most SSH systems are configured to use restrictive permissions on forwarded socket files (unless overridden; see the documentation for `StreamLocalBindMask` in `man ssh_config`), but you may wish to place the socket in a non-shared location like `~/.clipper.sock` rather than a shared one like `/tmp/clipper.sock` in any case.
469
sendto_test.sp https://gitlab.com/N3X15/sm-ext-socket.git | Unknown | 117 lines
20
21	new Handle:socket = SocketCreate(SOCKET_UDP, OnLSocketError);
22
23	SocketBind(socket, "0.0.0.0", port);
24	SocketListen(socket, OnLSocketIncoming);
25
26	new Handle:socket2 = SocketCreate(SOCKET_UDP, OnCSocketError);
27	//SocketConnect(socket2, OnCSocketConnect, OnCSocketReceive, OnCSocketDisconnect, "127.0.0.1", port);
28}
29
30public OnLSocketIncoming(Handle:socket, Handle:newSocket, String:remoteIP[], remotePort, any:arg) {
31	PrintToServer("%s:%d connected", remoteIP, remotePort);
33	SocketSetReceiveCallback(newSocket, OnChildSocketReceive);
34	SocketSetDisconnectCallback(newSocket, OnChildSocketDisconnect);
35	SocketSetErrorCallback(newSocket, OnChildSocketError);
README.md https://gitlab.com/mtellezgalindo/reveal.js-1.git | Markdown | 730 lines
484	dependencies: [
485		{ src: 'socket.io/socket.io.js', async: true },
486		{ src: 'plugin/notes-server/client.js', async: true }
534		// other deps
535		{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
536		{ src: 'plugin/multiplex/master.js', async: true },
561		// other deps
562		{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
563		{ src: 'plugin/multiplex/client.js', async: true }
575
576You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit ```http://example.com/token```, where ```http://example.com``` is the location of your socket.io server. Or if you're going to use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su), visit [http://revealjs.jit.su/token](http://revealjs.jit.su/token).
577
598		// other deps
599		{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
600		{ src: 'plugin/multiplex/client.js', async: true }
README.md https://gitlab.com/msloco/gitforteams.git | Markdown | 933 lines
636	dependencies: [
637		{ src: 'socket.io/socket.io.js', async: true },
638		{ src: 'plugin/notes-server/client.js', async: true }
685	dependencies: [
686		{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
687		{ src: 'plugin/multiplex/master.js', async: true },
713	dependencies: [
714		{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
715		{ src: 'plugin/multiplex/client.js', async: true }
729
730You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit ```http://example.com/token```, where ```http://example.com``` is the location of your socket.io server. Or if you're going to use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su), visit [http://revealjs.jit.su/token](http://revealjs.jit.su/token).
731
751	dependencies: [
752		{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
753		{ src: 'plugin/multiplex/client.js', async: true }
ftps_server.py https://gitlab.com/mitr/m2crypto.git | Python | 439 lines
171                cdc = ftp_server.xmit_channel(self, self.client_addr)
172            cdc.create_socket(socket.AF_INET, socket.SOCK_STREAM)
173            if self.bind_local_minus_one:
204                cdc = ftp_server.recv_channel(self, self.client_addr, fd)
205            cdc.create_socket(socket.AF_INET, socket.SOCK_STREAM)
206            try:
219            self._ssl_accepting = 1
220            self.socket = SSL.Connection(self.ssl_ctx, self.socket)
221            self.socket.setup_addr(self.addr)
282        asyncore.dispatcher.__init__(self)
283        self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
284        self.set_reuse_addr()
339        created and refers to the underlying connected socket."""
340        self.socket = SSL.Connection(self.ssl_ctx, self.socket)
341        self.socket.setup_addr(self.client_addr)
ftps_server.py https://gitlab.com/mitr/m2crypto.git | Python | 439 lines
171                cdc = ftp_server.xmit_channel(self, self.client_addr)
172            cdc.create_socket(socket.AF_INET, socket.SOCK_STREAM)
173            if self.bind_local_minus_one:
204                cdc = ftp_server.recv_channel(self, self.client_addr, fd)
205            cdc.create_socket(socket.AF_INET, socket.SOCK_STREAM)
206            try:
219            self._ssl_accepting = 1
220            self.socket = SSL.Connection(self.ssl_ctx, self.socket)
221            self.socket.setup_addr(self.addr)
282        asyncore.dispatcher.__init__(self)
283        self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
284        self.set_reuse_addr()
339        created and refers to the underlying connected socket."""
340        self.socket = SSL.Connection(self.ssl_ctx, self.socket)
341        self.socket.setup_addr(self.client_addr)
GCDAsyncSocket.m https://gitlab.com/mba811/tokaidoapp.git | Objective C | 7,825 lines
2956	
2957	int socketFD = (socket4FD != SOCKET_NULL) ? socket4FD : (socket6FD != SOCKET_NULL) ? socket6FD : socketUN;
2958	
6052		
6053		int socketFD = (socket4FD != SOCKET_NULL) ? socket4FD : (socket6FD != SOCKET_NULL) ? socket6FD : socketUN;
6054		
6448		
6449		int socketFD = (socket4FD != SOCKET_NULL) ? socket4FD : (socket6FD != SOCKET_NULL) ? socket6FD : socketUN;
6450		
6568	
6569	int socketFD = (socket4FD != SOCKET_NULL) ? socket4FD : (socket6FD != SOCKET_NULL) ? socket6FD : socketUN;
6570	
7397	
7398	int socketFD = (socket4FD != SOCKET_NULL) ? socket4FD : (socket6FD != SOCKET_NULL) ? socket6FD : socketUN;
7399	
Tokens4.xml https://gitlab.com/mba811/tokaidoapp.git | XML | 1,002 lines
29		<Token>
30			<TokenIdentifier>//apple_ref/occ/instm/GCDAsyncUdpSocket/initWithSocketQueue:</TokenIdentifier>
31			<Abstract type="html"></Abstract>
53		<Token>
54			<TokenIdentifier>//apple_ref/occ/instm/GCDAsyncUdpSocket/initWithDelegate:delegateQueue:socketQueue:</TokenIdentifier>
55			<Abstract type="html"></Abstract>
855		<Token>
856			<TokenIdentifier>//apple_ref/occ/instm/GCDAsyncUdpSocket/socketFD</TokenIdentifier>
857			<Abstract type="html">These methods are only available from within the context of a performBlock: invocation.
868		<Token>
869			<TokenIdentifier>//apple_ref/occ/instm/GCDAsyncUdpSocket/socket4FD</TokenIdentifier>
870			<Abstract type="html"></Abstract>
880		<Token>
881			<TokenIdentifier>//apple_ref/occ/instm/GCDAsyncUdpSocket/socket6FD</TokenIdentifier>
882			<Abstract type="html"></Abstract>
AsyncSocket.html https://gitlab.com/mba811/tokaidoapp.git | HTML | 2,723 lines
94	
95	<option value="//api/name/getCFSocket">&nbsp;&nbsp;&nbsp;&nbsp;- getCFSocket</option>
96	
236	
237	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/getCFSocket">getCFSocket</a></span></li>
238	
710		<span class="tooltip"><p>When you create an AsyncSocket, it is added to the runloop of the current thread.<br/>
711So for manually created sockets, it is easiest to simply create the socket on the thread you intend to use it.</p></span>
712	</span>
1737
1738<p>If a new socket is accepted, the <a href="#//api/name/delegate">delegate</a> method onSocket:wantsRunLoopForNewSocket: is called to<br/>
1739allow you to place the socket on a separate thread. This works best in conjunction with a thread pool design.</p>
1974Otherwise if maxLength bytes are read without completing the read,<br/>
1975it is treated similarly to a timeout - the socket is closed with a AsyncSocketReadMaxedOutError.<br/>
1976The read will complete successfully if exactly maxLength bytes are read and the given data is found at the end.</p>
GCDAsyncSocket.html https://gitlab.com/mba811/tokaidoapp.git | HTML | 3,662 lines
96	
97	<option value="//api/name/enableBackgroundingOnSocket">&nbsp;&nbsp;&nbsp;&nbsp;- enableBackgroundingOnSocket</option>
98	
104	
105	<option value="//api/name/initWithDelegate:delegateQueue:socketQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithDelegate:delegateQueue:socketQueue:</option>
106	
1194		<p>Tells the socket to begin listening and accepting connections on the given port.<br/>
1195When a connection is accepted, a new instance of GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> will be spawned to handle it,<br/>
1196and the socket:didAcceptNewSocket: <a href="#//api/name/delegate">delegate</a> method will be invoked.</p>
1980<ul>
1981<li>(void)socket:(GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> <em>)sock didConnectToHost:(NSString </em>)host port:(uint16_t)port<br/>
1982{<br/>
2049<p>The socket queue is optional.<br/>
2050If you pass NULL, GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> will automatically create it&rsquo;s own socket queue.<br/>
2051If you choose to provide a socket queue, the socket queue must not be a concurrent queue.</p>
AsyncSocket.html https://gitlab.com/mba811/tokaidoapp.git | HTML | 2,723 lines
94	
95	<option value="//api/name/getCFSocket">&nbsp;&nbsp;&nbsp;&nbsp;- getCFSocket</option>
96	
236	
237	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/getCFSocket">getCFSocket</a></span></li>
238	
710		<span class="tooltip"><p>When you create an AsyncSocket, it is added to the runloop of the current thread.<br/>
711So for manually created sockets, it is easiest to simply create the socket on the thread you intend to use it.</p></span>
712	</span>
1737
1738<p>If a new socket is accepted, the <a href="#//api/name/delegate">delegate</a> method onSocket:wantsRunLoopForNewSocket: is called to<br/>
1739allow you to place the socket on a separate thread. This works best in conjunction with a thread pool design.</p>
1974Otherwise if maxLength bytes are read without completing the read,<br/>
1975it is treated similarly to a timeout - the socket is closed with a AsyncSocketReadMaxedOutError.<br/>
1976The read will complete successfully if exactly maxLength bytes are read and the given data is found at the end.</p>
GCDAsyncSocket.html https://gitlab.com/mba811/tokaidoapp.git | HTML | 3,662 lines
96	
97	<option value="//api/name/enableBackgroundingOnSocket">&nbsp;&nbsp;&nbsp;&nbsp;- enableBackgroundingOnSocket</option>
98	
104	
105	<option value="//api/name/initWithDelegate:delegateQueue:socketQueue:">&nbsp;&nbsp;&nbsp;&nbsp;- initWithDelegate:delegateQueue:socketQueue:</option>
106	
1194		<p>Tells the socket to begin listening and accepting connections on the given port.<br/>
1195When a connection is accepted, a new instance of GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> will be spawned to handle it,<br/>
1196and the socket:didAcceptNewSocket: <a href="#//api/name/delegate">delegate</a> method will be invoked.</p>
1980<ul>
1981<li>(void)socket:(GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> <em>)sock didConnectToHost:(NSString </em>)host port:(uint16_t)port<br/>
1982{<br/>
2049<p>The socket queue is optional.<br/>
2050If you pass NULL, GCD<a href="../Classes/AsyncSocket.html">AsyncSocket</a> will automatically create it&rsquo;s own socket queue.<br/>
2051If you choose to provide a socket queue, the socket queue must not be a concurrent queue.</p>
index.js https://gitlab.com/mba811/webAudio.git | JavaScript | 236 lines
48  self.proxyOptions = self.options.proxy || {}
49  self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets
50  self.requests = []
107
108TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
109  var self = this
152      debug('tunneling connection has established')
153      self.sockets[self.sockets.indexOf(placeholder)] = socket
154      cb(socket)
174
175TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
176  var pos = this.sockets.indexOf(socket)
192  var self = this
193  TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
194    // 0 is dummy port for v0.6
index.html https://gitlab.com/mba811/tagspaces.git | HTML | 177 lines
50             (generate-reader (signed)
51               `(defun ,(integer-reader-name bytes signed) (socket)
52                  (declare (type stream socket)
54                  ,(if (= bytes 1)
55                       `(let ((result (the (unsigned-byte 8) (read-byte socket))))
56                          (declare (type (unsigned-byte 8) result))
61                                   :collect `(setf (ldb (byte 8 ,(* 8 byte)) result)
62                                                   (the (unsigned-byte 8) (read-byte socket))))
63                          ,(return-form signed))))))
80                       ,(integer-writer-name bytes nil)))
81      (defun ,(integer-writer-name bytes nil) (socket value)
82        (declare (type stream socket)
163
164(defun ensure-socket-is-closed (socket &amp;key abort)
165  (when (open-stream-p socket)
NETWORK.H https://gitlab.com/mba811/TortoiseGit.git | C Header | 250 lines
24/* pay attention to levels of indirection */
25typedef struct socket_function_table **Socket;
26typedef struct plug_function_table **Plug;
45    /* ignored by tcp, but vital for ssl */
46    const char *(*socket_error) (Socket s);
47};
171const char *sk_addr_error(SockAddr addr);
172#define sk_socket_error(s) (((*s)->socket_error) (s))
173
174/*
175 * Set the `frozen' flag on a socket. A frozen socket is one in
176 * which all READABLE notifications are ignored, so that data is
224
225typedef struct ssl_client_socket_function_table **SSL_Client_Socket;
226typedef struct ssl_client_plug_function_table **SSL_Client_Plug;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21