PageRenderTime 8ms queryFilters 0ms Sphinxql 461ms GetByIds 109ms meta 0ms repositoryFilters 6ms languageFilters 8ms sourceFilters 1ms

1,422,939 results for 'socket repo:win32/gitlab-ce' (8 ms)

Source

Language

Repository

socket.c https://github.com/RedOrion/macemu.git | C | 723 lines
23
24struct socket *
25solookup(head, laddr, lport, faddr, fport)
31{
32	struct socket *so;
33	
42	if (so == head)
43	   return (struct socket *)NULL;
44	return so;
48/*
49 * Create a new socket, initialise the fields
50 * It is the responsibility of the caller to
57	
58  so = (struct socket *)malloc(sizeof(struct socket));
59  if(so) {
socket.c https://github.com/bbt123/postgres.git | C | 678 lines
19 *
20 * Since the socket emulation layer always sets the actual socket to
21 * non-blocking mode in order to be able to deliver signals, we must
131int
132pgwin32_waitforsinglesocket(SOCKET s, int what, int timeout)
133{
134	static HANDLE waitevent = INVALID_HANDLE_VALUE;
135	static SOCKET current_socket = INVALID_SOCKET;
136	static int	isUDP = 0;
405	/*
406	 * Readiness of socket to send data to UDP socket may be not true: socket
407	 * can become busy again! So loop until send or error occurs.
455										 * 2*FD_SETSIZE sockets */
456	SOCKET		sockets[FD_SETSIZE * 2];
457	int			numevents = 0;
udp-socket.h https://github.com/jianhuiz/contiki.git | C++ Header | 194 lines
54 */
55typedef void (* udp_socket_input_callback_t)(struct udp_socket *c,
56                                             void *ptr,
139 */
140int udp_socket_connect(struct udp_socket *c,
141                       uip_ipaddr_t *remote_addr,
154 */
155int udp_socket_send(struct udp_socket *c,
156                    const void *data, uint16_t datalen);
173 */
174int udp_socket_sendto(struct udp_socket *c,
175                      const void *data, uint16_t datalen,
190 */
191int udp_socket_close(struct udp_socket *c);
192
tcp-socket.h https://github.com/jianhuiz/contiki.git | C++ Header | 269 lines
145 */
146int tcp_socket_register(struct tcp_socket *s, void *ptr,
147                         uint8_t *input_databuf, int input_databuf_len,
243 * \brief      Close a connected TCP socket
244 * \param s    A pointer to a TCP socket that must have been previously registered with tcp_socket_register()
245 * \retval -1  If an error occurs
252 */
253int tcp_socket_close(struct tcp_socket *s);
254
256 * \brief      Unregister a registered socket
257 * \param s    A pointer to a TCP socket that must have been previously registered with tcp_socket_register()
258 * \retval -1  If an error occurs
266 */
267int tcp_socket_unregister(struct tcp_socket *s);
268#endif /* TCP_SOCKET_H */
socket.test.js https://github.com/taoyuan/musher.js.git | JavaScript | 143 lines
4
5describe('socket', function () {
6
21
22        var socket;
23
24        beforeEach(function () {
25            socket = s.connect('test_key');
26        });
28        afterEach(function (done) {
29            socket.close(done);
30        });
32
33        it('should initiate socket', function () {
34            t.ok(socket);
socket-io-auth.markdown https://github.com/insaneitskills/howtonode.org.git | Unknown | 81 lines
5
6Finding a decent article about session based authorization in socket.io is more difficult than one expected. This article will show how you can take advantage of Express session middleware and socket.io authorization middleware to create a very simple authorization mechanism when establishing new socket.io connections.
7
9
10I decided to write this article after getting a bit frustrated from searching the Internet for a decent example on how to use session based authorization with socket.io. To be honest, socket.io wiki page on [authorization](https://github.com/LearnBoost/socket.io/wiki/Authorizing) was quite simple to follow and understand, but when it came to **session based** authorization, I got a bit lost (especially considering the fact that it's my third day using Node...). 
11
22
23First I would like to distinguish between two authorization scopes that are currently supported by socket.io, namely - Global and Namespace. *Global* authorization will be used to authorize any attempt to open a (socket.io) connection against our Node application. *Namespace* authorization, on the other hand, allows you to use different authorization rules when accepting connections to a specific socket.io namespace (more on namespaces can be found [here](http://socket.io/#how-to-use))
24
28
29It's important to understand that the authorization process takes place during handshake. This means that, prior to authorization, no socket connection is established. As a matter of fact, because the handshakes in socket.io are implemented as HTTP calls, one can use the HTTP context to get relevant information on the user who's trying to connect. As you'll see next, I will be using cookie data to authorize any user that tried to establish a socket connection to the server.
30
66
67<socket-io-auth/socket-io-snippet.js>
68
xio-socket.c https://github.com/xscc/socat.git | C | 2,122 lines
69/* generic socket addresses */
70const struct addrdesc xioaddr_socket_connect = { "socket-connect",     1, xioopen_socket_connect,  GROUP_FD|GROUP_SOCKET|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<domain>:<protocol>:<remote-address>") };
71#if WITH_LISTEN
71#if WITH_LISTEN
72const struct addrdesc xioaddr_socket_listen  = { "socket-listen",      1, xioopen_socket_listen,   GROUP_FD|GROUP_SOCKET|GROUP_LISTEN|GROUP_RANGE|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<domain>:<protocol>:<local-address>") };
73#endif /* WITH_LISTEN */
74const struct addrdesc xioaddr_socket_sendto  = { "socket-sendto",      3, xioopen_socket_sendto,   GROUP_FD|GROUP_SOCKET,                         0, 0, 0 HELP(":<domain>:<type>:<protocol>:<remote-address>") };
75const struct addrdesc xioaddr_socket_datagram= { "socket-datagram",    3, xioopen_socket_datagram, GROUP_FD|GROUP_SOCKET|GROUP_RANGE,             0, 0, 0 HELP(":<domain>:<type>:<protocol>:<remote-address>") };
76const struct addrdesc xioaddr_socket_recvfrom= { "socket-recvfrom",    3, xioopen_socket_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_RANGE|GROUP_CHILD, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<local-address>") };
76const struct addrdesc xioaddr_socket_recvfrom= { "socket-recvfrom",    3, xioopen_socket_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_RANGE|GROUP_CHILD, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<local-address>") };
77const struct addrdesc xioaddr_socket_recv    = { "socket-recv",        1, xioopen_socket_recv,     GROUP_FD|GROUP_SOCKET|GROUP_RANGE,             0, 0, 0 HELP(":<domain>:<type>:<protocol>:<local-address>") };
78#endif /* WITH_GENERICSOCKET */
150#ifdef SO_PEERCRED
151const struct optdesc opt_so_peercred = { "so-peercred", "peercred", OPT_SO_PEERCRED, GROUP_SOCKET, PH_PASTSOCKET, TYPE_INT3,OFUNC_SOCKOPT, SOL_SOCKET, SO_PEERCRED};
152#endif
socket.js https://github.com/kirillKey/questSearchTrain.git | JavaScript | 385 lines
5
6var parser = require('socket.io-parser');
7var Emitter = require('component-emitter');
10var bind = require('component-bind');
11var debug = require('debug')('socket.io-client:socket');
12var hasBin = require('has-binary');
17
18module.exports = exports = Socket;
19
46/**
47 * `Socket` constructor.
48 *
51
52function Socket(io, nsp){
53  this.io = io;
socket.js https://github.com/kirillKey/questSearchTrain.git | JavaScript | 431 lines
6var Emitter = require('events').EventEmitter;
7var parser = require('socket.io-parser');
8var url = require('url');
8var url = require('url');
9var debug = require('debug')('socket.io:socket');
10var hasBin = require('has-binary-data');
15
16module.exports = exports = Socket;
17
57
58function Socket(nsp, client){
59  this.nsp = nsp;
76
77Socket.prototype.__proto__ = Emitter.prototype;
78
socket.js https://github.com/kirillKey/questSearchTrain.git | JavaScript | 379 lines
5
6var parser = require('socket.io-parser');
7var Emitter = require('component-emitter');
10var bind = require('component-bind');
11var debug = require('debug')('socket.io-client:socket');
12var hasBin = require('has-binary-data');
18
19module.exports = exports = Socket;
20
47/**
48 * `Socket` constructor.
49 *
52
53function Socket(io, nsp){
54  this.io = io;
socket.js https://github.com/ggouv/elgg-nodejs.git | JavaScript | 126 lines
13	 */
14	io.sockets.on('connect', function(socket) {
15
31		}
32		Users[sessionCookie].sockets[socket.id] = socket; // add socket to User
33
35		_.each(Users[sessionCookie].rooms, function(room) {
36			_.invoke(Users[sessionCookie].sockets, 'join', room); // join room for all sockets of this user
37			_.invoke(Users[sessionCookie].sockets, 'emit', 'join_room', Rooms[room]); // send data of this room
56			timeouts[sessionCookie] = setTimeout(function() {
57				if (Users[sessionCookie] && _.size(Users[sessionCookie].sockets) == 0) { // no socket ? -> all tabs/socket are closed.
58					var user = Users[sessionCookie].guid;
92		socket.on('get_rooms', function() {
93			var rooms = io.sockets.manager.roomClients[socket.id];
94			socket.emit('get_rooms', rooms);
socket.rb https://github.com/Jonono2/metasploit-framework.git | Ruby | 775 lines
1# -*- coding: binary -*-
2require 'socket'
3require 'thread'
43  #
44  # Create a socket using the supplied Rex::Socket::Parameter instance.
45  #
108      begin
109        s = ::Socket.new(::Socket::AF_INET6, ::Socket::SOCK_DGRAM, ::Socket::IPPROTO_UDP)
110        s.close
612  #
613  # sf: This create a socket pair using native ruby sockets and will work
614  # on Windows where ::Socket.pair is not implemented.
656  #
657  # Create a UDP socket pair using native ruby UDP sockets.
658  #
socket.js https://github.com/paramarco/visible.git | JavaScript | 430 lines
6var Emitter = require('events').EventEmitter;
7var parser = require('socket.io-parser');
8var url = require('url');
8var url = require('url');
9var debug = require('debug')('socket.io:socket');
10var hasBin = require('has-binary-data');
15
16module.exports = exports = Socket;
17
57
58function Socket(nsp, client){
59  this.nsp = nsp;
76
77Socket.prototype.__proto__ = Emitter.prototype;
78
socket.c https://github.com/aihimel/geany.git | C | 832 lines
228
229	if (g_lstat(socket_info.file_name, &socket_stat) == 0)
230	{	/* If the user id of the process is not the same as the owner of the socket
348	if (socket_info.lock_socket_tag > 0)
349		g_source_remove(socket_info.lock_socket_tag);
350	if (socket_info.read_ioc)
361	{
362		remove_socket_link_full(); /* deletes the socket file and the symlink */
363		g_free(socket_info.file_name);
423	 * file system which doesn't support sockets, we just link the socket there and create the
424	 * real socket in the system's tmp directory assuming it supports sockets */
425	real_path = g_strdup_printf("%s%cgeany_socket.%08x",
433	}
434	/* create a symlink in e.g. ~/.config/geany/geany_socket_hostname__0 to /tmp/geany_socket.499602d2 */
435	else if (symlink(real_path, path) != 0)
Socket.idr https://github.com/ejenk/Idris-dev.git | Unknown | 350 lines
39-- Socket Types.
40data SocketType = NotASocket  -- Not a socket, used in certain operations
41                | Stream      -- TCP
138-- Returns either a socket or an error.
139socket : SocketFamily -> SocketType -> ProtocolNumber -> IO (Either SocketError Socket)
140socket sf st pn = do
209
210accept : Socket -> IO (Either SocketError (Socket, SocketAddress))
211accept sock = do
275
276sendTo : Socket -> SocketAddress -> Port -> String -> IO (Either SocketError ByteLength)
277sendTo sock addr p dat = do
285
286sendToBuf : Socket -> SocketAddress -> Port -> BufPtr -> ByteLength -> IO (Either SocketError ByteLength)
287sendToBuf sock addr p (BPtr dat) len = do
Socket.h https://github.com/smuehlmann/xbmc-pvr-addons.git | C++ Header | 276 lines
50  #include <sys/types.h>     /* for socket,connect */
51  #include <sys/socket.h>    /* for socket,connect */
52  #include <sys/un.h>        /* for Unix socket */
130     */
131    Socket(const enum SocketFamily family, const enum SocketDomain domain, const enum SocketType type, const enum SocketProtocol protocol = tcp);
132    Socket(void);
238
239    SOCKET _sd;                         ///< Socket Descriptor
240    SOCKADDR_IN _sockaddr;              ///< Socket Address
242    enum SocketFamily _family;          ///< Socket Address Family
243    enum SocketProtocol _protocol;      ///< Socket Protocol
244    enum SocketType _type;              ///< Socket Type
244    enum SocketType _type;              ///< Socket Type
245    enum SocketDomain _domain;          ///< Socket domain
246
socket.rb https://github.com/trmchale1/personal_website.git | Ruby | 252 lines
9    def params
10      Excon.display_warning('Excon::Socket#params is deprecated use Excon::Socket#data instead.')
11      @data
156    def local_port
157      ::Socket.unpack_sockaddr_in(@socket.to_io.getsockname)[0]
158    rescue ArgumentError => e
195          if @data[:reuseaddr]
196            socket.setsockopt(::Socket::Constants::SOL_SOCKET, ::Socket::Constants::SO_REUSEADDR, true)
197            if defined?(::Socket::Constants::SO_REUSEPORT)
197            if defined?(::Socket::Constants::SO_REUSEPORT)
198              socket.setsockopt(::Socket::Constants::SOL_SOCKET, ::Socket::Constants::SO_REUSEPORT, true)
199            end
232        rescue SystemCallError => exception
233          socket.close rescue nil if socket
234          next
socket.lua https://github.com/CoRfr/legato-af.git | Lua | 664 lines
8-- Contributors:
9--     Diego Nehab - Original tests for LuaSocket 2.0.2
10--     Cuero Bugot for Sierra Wireless - Porting to unittest test harness
13local u = require 'unittest'
14local socket = require 'socket'
15
15
16local t=u.newtestsuite("socket")
17local enableDebugTests
35    control, err = socket.connect(host, port)
36    if not control then u.abort("Failed to setup TCP test server connection: ["..err.."]\r\nVerify that you launched the socket test server: \"lua luafwk/luasocket/sockettestsvr.lua\"") end
37    control:setoption("tcp-nodelay", true)
72function t:test_tcp_methods()
73    test_methods(socket.tcp(), {
74    "accept",
socket.h https://github.com/danielchow/libnode.git | C++ Header | 1,020 lines
38
39class Socket : public events::EventEmitter<node::net::Socket> {
40 public:
40 public:
41    LIBJ_MUTABLE_DEFS(Socket, LIBNODE_NET_SOCKET);
42
62    static Ptr create(uv::Stream* handle, Boolean allowHalfOpen) {
63        Socket* sock = new Socket();
64        sock->handle_ = handle;
414
415        Socket* sock = new Socket();
416        sock->handle_ = pipe;
432
433    static void initSocketHandle(Socket* self) {
434        self->flags_ = 0;
Socket.idr https://github.com/Heather/Idris-dev.git | Unknown | 371 lines
82
83||| SocketDescriptor: Native C Socket Descriptor
84SocketDescriptor : Type
153||| number. Returns either a socket or an error.
154socket : SocketFamily -> SocketType -> ProtocolNumber -> IO (Either SocketError Socket)
155socket sf st pn = do
228
229accept : Socket -> IO (Either SocketError (Socket, SocketAddress))
230accept sock = do
294
295sendTo : Socket -> SocketAddress -> Port -> String -> IO (Either SocketError ByteLength)
296sendTo sock addr p dat = do
305
306sendToBuf : Socket -> SocketAddress -> Port -> BufPtr -> ByteLength -> IO (Either SocketError ByteLength)
307sendToBuf sock addr p (BPtr dat) len = do
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21