PageRenderTime 10ms queryFilters 1ms Sphinxql 409ms GetByIds 43ms meta 0ms repositoryFilters 6ms languageFilters 3ms sourceFilters 1ms

1,422,939 results for 'socket repo:fuzzynemesis/pump.io' (10 ms)

Source

Language

Repository

Socket.php https://github.com/mcherryleigh/seniordesign.git | PHP | 430 lines
19//
20// $Id: Socket.php,v 1.1 2005/07/22 05:10:14 max Exp $
21//
31 */
32class Net_Socket extends PEAR {
33
35
36    /** Socket file pointer. */
37    var $fp = null;
38
39    /** Whether the socket is blocking. */
40    var $blocking = true;
410     * Read until the socket closes. THIS FUNCTION WILL NOT EXIT if the
411     * socket is in blocking mode until the socket closes.
412     *
067-req-socket.t https://github.com/liyao0409/tengine.git | Unknown | 755 lines
3use lib 'lib';
4use Test::Nginx::Socket;
5
26        content_by_lua '
27            local sock, err = ngx.req.socket()
28            if sock then
28            if sock then
29                ngx.say("got the request socket")
30            else
30            else
31                ngx.say("failed to get the request socket: ", err)
32            end
47--- response_body
48got the request socket
49received: hello
tcp-socket.t https://github.com/liyao0409/tengine.git | Unknown | 2,039 lines
3use lib 'lib';
4use Test::Nginx::Socket;
5
100        rewrite_by_lua '
101            local sock = ngx.socket.tcp()
102            local port = ngx.var.port
169        rewrite_by_lua '
170            local sock = ngx.socket.tcp()
171            local port = ngx.var.port
199--- error_log
200attempt to send data on a closed socket:
201
1428--- error_log eval
1429["lua reuse socket upstream", "lua tcp socket reconnect without shutting down"]
1430
116-raw-req-socket.t https://github.com/dome/lixen_app.git | Unknown | 782 lines
31        content_by_lua '
32            local sock = ngx.socket.tcp()
33            local port = ngx.var.port
65            if not ok then
66                ngx.say("failed to close socket: ", err)
67                return
77            ngx.req.read_body()
78            local sock, err = ngx.req.socket(true)
79            if not sock then
79            if not sock then
80                ngx.log(ngx.ERR, "server: failed to get raw req socket: ", err)
81                return
103--- error_log
104lua raw req socket tcp_nodelay
105--- no_error_log
socket.c https://github.com/luozhongchao/Firmware.git | C | 287 lines
1/****************************************************************************
2 * net/socket.c
3 *
54/****************************************************************************
55 * Function: psock_socket
56 *
57 * Description:
58 *   socket() creates an endpoint for communication and returns a socket
59 *   structure.
61 * Parameters:
62 *   domain   (see sys/socket.h)
63 *   type     (see sys/socket.h)
91
92int psock_socket(int domain, int type, int protocol, FAR struct socket *psock)
93{
socket.py https://github.com/kingxsp/evergreen.git | Python | 576 lines
42__all__     = __socket__.__all__
43__patched__ = ['fromfd', 'socketpair', 'ssl', 'socket', 'SocketType',
44               'gethostbyname', 'gethostbyname_ex', 'getnameinfo', 'getaddrinfo',
50if six.PY3:
51    from socket import socket as __socket__socket__
52
53    # for ssl.py to create weakref
54    class _realsocket(_socket.socket):
55        pass
92    _fileobject = __socket__._fileobject
93    _realsocket = _socket.socket
94
555try:
556    __original_socketpair__ = __socket__.socketpair
557    def socketpair(*args):
Socket.hpp https://github.com/Krozark/cpp-Socket.git | C++ Header | 307 lines
18    #include <netdb.h> /* gethostbyname */
19    #define INVALID_SOCKET -1
20    #define SOCKET_ERROR -1
20    #define SOCKET_ERROR -1
21    #define closesocket(s) ::close(s)
22    typedef int SOCKET;
102
103        Socket& operator=(const Socket&) = delete;
104
107         */
108        SOCKET id()const{return sock;}
109
291         */
292        SOCKET sock; ///< C socket type
293        SOCKADDR_IN sock_cfg; ///< configuration struct
os-socket.h https://github.com/jzeaherra/xbmc-pvr-addons.git | C++ Header | 319 lines
54  //@{
55  inline void SocketClose(socket_t socket)
56  {
170  //@{
171  inline void TcpSocketClose(tcp_socket_t socket)
172  {
175
176  inline void TcpSocketShutdown(tcp_socket_t socket)
177  {
181
182  inline ssize_t TcpSocketWrite(tcp_socket_t socket, int *iError, void* data, size_t len)
183  {
286
287  inline bool TcpConnectSocket(tcp_socket_t socket, struct addrinfo* addr, int *iError, uint64_t iTimeout = 0)
288  {
socket.js https://github.com/deepinit-arek/socket.io-client.git | JavaScript | 358 lines
5
6var parser = require('socket.io-parser')
7  , Emitter = require('./emitter')
8  , toArray = require('to-array')
9  , debug = require('debug')('socket.io-client:socket')
10  , on = require('./on')
16
17module.exports = exports = Socket;
18
36/**
37 * `Socket` constructor.
38 *
41
42function Socket(io, nsp){
43  this.io = io;
socket.h https://github.com/alepharchives/ULib.git | C++ Header | 689 lines
141
142            USocket(bool bSocketIsIPv6 = false);
143   virtual ~USocket();
507   /**
508   The socket transmits the data to the remote socket.
509   */
577
578   virtual void closesocket() { _closesocket(); }
579
582   /**
583   This method is called to connect the socket to a server TCP socket that is specified
584   by the provided IP Address and port number. We call the connect() method to perform the connection
664   USocket(const USocket&)            {}
665   USocket& operator=(const USocket&) { return *this; }
666
socket.io.js https://github.com/sa4250mnpo70/Socket.IO-rack.git | JavaScript | 1,897 lines
404		// we make sure WebSocket is not confounded with a previously loaded flash WebSocket
405		return 'WebSocket' in window && WebSocket.prototype && ( WebSocket.prototype.send && !!WebSocket.prototype.send.toString().match(/native/i)) && typeof WebSocket !== "undefined";
406	};
785			resource: 'socket.io',
786			transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling'],
787			transportOptions: {
901	
902	Socket.prototype.addListener = Socket.prototype.addEvent = Socket.prototype.addEventListener = Socket.prototype.on;
903	
1814    if (!window.WEB_SOCKET_SWF_LOCATION) {
1815      console.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");
1816      return;
1839    swfobject.embedSWF(
1840      WEB_SOCKET_SWF_LOCATION, "webSocketFlash",
1841      "1" /* width */, "1" /* height */, "9.0.0" /* SWF version */,
socket.txt https://github.com/manugarg/articles.git | Unknown | 259 lines
1			MIGHTY SOCKETS
2			==============
6
7In simple terms, a socket is an endpoint of communication. And a
8connection is represented by a socket pair. Remember, not all
8connection is represented by a socket pair. Remember, not all
9communication is connection oriented. So, you can have a single socket
10also doing most of the job for you (e.g. UDP sockets). A process deals
10also doing most of the job for you (e.g. UDP sockets). A process deals
11with the socket in the same way as it deals with files. We'll see more
12of this similarity in coming sections.
21
22	//socket(2) prototype: socket(int domain, int type, int protocol)
23
39
40How sockets are addressed depends upon the domain of the socket. For
41example, an INET domain socket is identified by ip address and port
socket.html https://github.com/manugarg/articles.git | HTML | 359 lines
2<head>
3  <title>Mighty Sockets</title>
4  <style type="text/css">
76<pre>
77Sockets are indeed the window to networking and networking drives the
78whole world some way or other, that's why the name "Mighty Sockets".
79
80In simple terms, a socket is an endpoint of communication. And a
81connection is represented by a socket pair. Remember, not all
94
95	//socket(2) prototype: socket(int domain, int type, int protocol)
96
112
113How sockets are addressed depends upon the domain of the socket. For
114example, an INET domain socket is identified by ip address and port
socket.io.js https://github.com/dmcaodha/backbone-express-mongoose-socketio.git | JavaScript | 1,917 lines
15		this.path = /\/$/.test(path) ? path : path + '/';
16		WEB_SOCKET_SWF_LOCATION = path + 'lib/vendor/web-socket-js/WebSocketMain.swf';
17	}
22if (typeof window != 'undefined'){
23	WEB_SOCKET_SWF_LOCATION = WEB_SOCKET_SWF_LOCATION || (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cdn.socket.io/' + this.io.version + '/WebSocketMain.swf';
24}
404		// we make sure WebSocket is not confounded with a previously loaded flash WebSocket
405		return 'WebSocket' in window && WebSocket.prototype && ( WebSocket.prototype.send && !!WebSocket.prototype.send.toString().match(/native/i)) && typeof WebSocket !== "undefined";
406	};
920	
921	Socket.prototype.addListener = Socket.prototype.addEvent = Socket.prototype.addEventListener = Socket.prototype.on;
922	
1833    if (!window.WEB_SOCKET_SWF_LOCATION) {
1834      console.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");
1835      return;
socket.h https://github.com/karlpilkington/tapip.git | C++ Header | 65 lines
1#ifndef __SOCKET_H
2#define __SOCKET_H
27struct sock_addr;
28/* protocol dependent socket apis */
29struct socket_ops {
29struct socket_ops {
30	int (*socket)(struct socket *, int);
31	int (*close)(struct socket *);
31	int (*close)(struct socket *);
32	int (*accept)(struct socket *, struct socket *, struct sock_addr *);
33	int (*listen)(struct socket *, int);
51
52extern struct socket *_socket(int, int, int);
53extern int _listen(struct socket *, int);
55extern int _bind(struct socket *, struct sock_addr *);
56extern struct socket *_accept(struct socket *, struct sock_addr *);
57extern int _send(struct socket *, void *, int, struct sock_addr *);
Socket.java https://github.com/emitrom/titanium4j.git | Java | 124 lines
1/************************************************************************
2  Socket.java is part of Ti4j 3.1.0  Copyright 2013 Emitrom LLC
3
23/**
24 * Socket module, used for creating sockets.
25 */
33
34    private static Socket instance = null;
35
53     * defined in 'titanium.network.socket.tcp'. some properties are only needed
54     * based on whether the socket will be a connecting socket or a listening
55     * socket.
68     * defined in 'titanium.network.socket.tcp'. some properties are only needed
69     * based on whether the socket will be a connecting socket or a listening
70     * socket.
socket.rb https://github.com/rinrinne/excon.git | Ruby | 186 lines
23      addrinfo = if @proxy
24        ::Socket.getaddrinfo(@proxy[:host], @proxy[:port].to_i, ::Socket::Constants::AF_UNSPEC, ::Socket::Constants::SOCK_STREAM)
25      else
25      else
26        ::Socket.getaddrinfo(@params[:host], @params[:port].to_i, ::Socket::Constants::AF_UNSPEC, ::Socket::Constants::SOCK_STREAM)
27      end
33
34          socket = ::Socket.new(a_family, s_type, 0)
35
56
57            @socket = socket
58            break
59          rescue Errno::EISCONN
60            @socket = socket
61            break
socket.c https://github.com/gonzopancho/android-external-openvpn.git | C | 2,785 lines
590static void
591create_socket (struct link_socket *sock)
592{
2423int
2424socket_send_queue (struct link_socket *sock, struct buffer *buf, const struct link_socket_actual *to)
2425{
2702      const int errnum = openvpn_errno_socket ();
2703      msg (M_FATAL, "%s: Socket bind[%d] failed on unix domain socket %s: %s",
2704	   prefix,
2717socket_descriptor_t
2718socket_accept_unix (socket_descriptor_t sd,
2719		    struct sockaddr_un *remote)
2729int
2730socket_connect_unix (socket_descriptor_t sd,
2731		     struct sockaddr_un *remote)
socket.js https://github.com/predominant/subway.git | JavaScript | 179 lines
9
10module.exports = function(socket, connections) {
11  var current_user;
16  
17  socket.on('register', function(data) {
18    bcrypt.genSalt(10, function(err, salt) {
24        user.save();
25        socket.emit('register_success', {username: user.username});
26        current_user = user;
87    // register this socket with our user's IRC connection
88    connection.addSocket(socket);
89    
151        // keep the session alive, remove this socket, and clear unreads
152        connection.removeSocket(socket);
153        connection.clearUnreads();
socket.c https://github.com/cmcl/geany.git | C | 810 lines
220
221	if (g_lstat(socket_info.file_name, &socket_stat) == 0)
222	{	/* If the user id of the process is not the same as the owner of the socket
338	if (socket_info.lock_socket_tag > 0)
339		g_source_remove(socket_info.lock_socket_tag);
340	if (socket_info.read_ioc)
351	{
352		remove_socket_link_full(); /* deletes the socket file and the symlink */
353		g_free(socket_info.file_name);
413	 * file system which doesn't support sockets, we just link the socket there and create the
414	 * real socket in the system's tmp directory assuming it supports sockets */
415	real_path = g_strdup_printf("%s%cgeany_socket.%08x",
423	}
424	/* create a symlink in e.g. ~/.config/geany/geany_socket_hostname__0 to /tmp/geany_socket.499602d2 */
425	else if (symlink(real_path, path) != 0)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21