PageRenderTime 1907ms queryFilters 0ms Sphinxql 480ms GetByIds 1407ms meta 0ms repositoryFilters 3ms languageFilters 2ms sourceFilters 1ms

1,422,939 results for 'socket repo:fawzi/blip' (1907 ms)

Source

Language

Repository

socket.c https://github.com/booo/imapfilter.git | C | 439 lines
7#include <netdb.h>
8#include <sys/socket.h>
9#include <sys/types.h>
45	while (res) {
46		sockfd = socket(res->ai_family, res->ai_socktype,
47		    res->ai_protocol);
66
67	ssn->socket = sockfd;
68
75
76	return ssn->socket;
77}
107
108	SSL_set_fd(ssn->sslconn, ssn->socket);
109
socket.c https://github.com/outbred/libimobiledevice-win32.git | C | 393 lines
1/*
2 * socket.c
3 *
34#else
35#include <sys/socket.h>
36#include <sys/un.h>
40#endif
41#include "socket.h"
42
46
47void socket_set_verbose(int level)
48{
52#ifndef WIN32
53int socket_create_unix(const char *filename)
54{
socket.cc https://github.com/bhesmans/click.git | C++ | 544 lines
2/*
3 * socket.{cc,hh} -- transports packets via sockets
4 * Mark Huang <mlhuang@cs.princeton.edu>
41
42Socket::Socket()
43  : _task(this), _timer(this),
51
52Socket::~Socket()
53{
126int
127Socket::initialize_socket_error(ErrorHandler *errh, const char *syscall)
128{
145  if (_fd < 0)
146    return initialize_socket_error(errh, "socket");
147
socket.lua https://github.com/yunnet/skynet.git | Lua | 270 lines
1local buffer = require "socketbuffer"
2local skynet = require "skynet"
16local selfaddr = skynet.self()
17local sockets = assert(skynet.localname ".socket")
18
93
94local socket = {}
95
95
96function socket.open(addr, port)
97	local cmd = "open" .. " " .. (port and (addr..":"..port) or addr)
97	local cmd = "open" .. " " .. (port and (addr..":"..port) or addr)
98	local r = skynet.call(sockets, "text", cmd)
99	if r == "" then
107
108function socket.stdin()
109	local r = skynet.call(sockets, "text", "bind 1")
socket.js https://github.com/carlgrundberg/pivoter-angular.git | JavaScript | 75 lines
33
34    function send_update(socket) {
35        state.total = total_voters();
38        if (socket) {
39            console.log('sending update to socket ' + socket.id);
40            socket.emit('update', state);
42            console.log('sending update to all');
43            io.sockets.emit('update', state);
44        }
46
47    io.sockets.on('connection', function (socket) {
48
48
49        var address = socket.handshake.address;
50        console.log("New connection from " + address.address + ":" + address.port + " (" + socket.handshake.headers.referer + ")");
socket.io.d.ts https://github.com/Ziriax/DefinitelyTyped.git | Unknown | 71 lines
12	export function listen(server: http.Server, options: any, fn: Function): SocketManager;
13	export function listen(server: http.Server, fn?: Function): SocketManager;
14	export function listen(port: Number): SocketManager;
34    emit(ev: any, ...data:any[]): Socket;
35    on(ns: string, fn: Function): Socket;
36  }
44    in(room: string): SocketNamespace;
45    on(evt: string, fn: (socket: Socket) => void): SocketNamespace;
46    to(room: string): SocketNamespace;
49    emit(ev: any, ...data:any[]): Socket;
50    socket(sid: any, readable: boolean): Socket;
51    authorization(fn: Function): SocketNamespace;
64    on(ns: string, fn: Function): SocketManager;
65    sockets: SocketNamespace;
66  }
socket.c https://bitbucket.org/hjwhang/libimobiledevice-win32.git | C | 407 lines
1/*
2* socket.c
3*
34#else
35#include <sys/socket.h>
36#include <sys/un.h>
40#endif
41#include "socket.h"
42
46
47void socket_set_verbose(int level)
48{
52#ifndef WIN32
53int socket_create_unix(const char *filename)
54{
socket.js https://github.com/uniteddiversity/scrollback.git | JavaScript | 478 lines
21/*
22	Websockets gateway
23*/
42sock.on('connection', function (socket) {
43	var conn = { socket: socket };
44	
44	
45	socket.on('data', function(d) {
46		try { d = JSON.parse(d); log ("Socket received ", d); }
64		log("Sending", data.length, 'bytes: ', data.substr(0,50));
65		socket.write(data);
66	};
148				core.emit("message", { type: 'away', from: user.id, to: room,
149					time: new Date().getTime(), session:"web:"+conn.socket.remoteAddress+":"+ conn.sid,origin : {gateway : "web", location : "", ip :  conn.socket.remoteAddress}}, function(err, m) {
150						log(err, m);
socket.io.d.ts https://github.com/tumada/test02.git | TypeScript | 71 lines
12	export function listen(server: http.Server, options: any, fn: Function): SocketManager;
13	export function listen(server: http.Server, fn?: Function): SocketManager;
14	export function listen(port: Number): SocketManager;
34    emit(ev: any, ...data:any[]): Socket;
35    on(ns: string, fn: Function): Socket;
36  }
44    in(room: string): SocketNamespace;
45    on(evt: string, fn: (socket: Socket) => void): SocketNamespace;
46    to(room: string): SocketNamespace;
49    emit(ev: any, ...data:any[]): Socket;
50    socket(sid: any, readable: boolean): Socket;
51    authorization(fn: Function): SocketNamespace;
64    on(ns: string, fn: Function): SocketManager;
65    sockets: SocketNamespace;
66  }
socket.js https://github.com/joker-2013/peerjs.git | JavaScript | 200 lines
1/**
2 * An abstraction on top of WebSockets and XHR streaming to provide fastest
3 * possible connection for peers.
5function Socket(secure, host, port, path, key) {
6  if (!(this instanceof Socket)) return new Socket(secure, host, port, path, key);
7
35/** Start up websocket communications. */
36Socket.prototype._startWebSocket = function(id) {
37  var self = this;
42
43  this._socket = new WebSocket(this._wsUrl);
44
153Socket.prototype._wsOpen = function() {
154  return this._socket && this._socket.readyState == 1;
155}
socket.h https://github.com/charlieyqin/development_misc.git | C++ Header | 100 lines
33
34enum TypeSocket {BlockingSocket, NonBlockingSocket};
35
60
61  Socket(SOCKET s);
62  Socket();
79
80class SocketServer : public Socket {
81public:
81public:
82  SocketServer(int port, int connections, TypeSocket type=BlockingSocket);
83
89  public:
90    SocketSelect(Socket const * const s1, Socket const * const s2=NULL, TypeSocket type=BlockingSocket);
91
client-side-socket-io.html https://github.com/evenisse/WebRTC-Experiment.git | HTML | 221 lines
1<title>Simple client-side WebRTC Experiment using Socket.io over PubNub ® Muaz Khan</title>
2<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
3
4<h1>Simple client-side WebRTC Experiment using Socket.io over PubNub</h1>
5
5
6<meta name="description" content="A client side WebRTC experiment/demo using socket.io over pubnub! It is simple. It is included here for newcomers who are interested to learn WebRTC from demos!">
7<link rel="author" type="text/html" href="https://plus.google.com/100325991024054712503">
13    <a href="/">Home</a>
14    » <a href="https://github.com/muaz-khan/WebRTC-Experiment/blob/master/demos/client-side-socket-io.html">Source Code</a>
15</div>
27<script src="/lib/RTCPeerConnection-v1.4.js"></script>
28<script src="/dependencies/socket.io.js"></script>
29
41<script>
42    var socket;
43    function openSocket() {
socket.js https://github.com/barmatz/insight.git | JavaScript | 72 lines
3var ScopedSocket = function(socket, $rootScope) {
4  this.socket = socket;
5  this.$rootScope = $rootScope;
21ScopedSocket.prototype.on = function(event, callback) {
22  var socket = this.socket;
23  var $rootScope = this.$rootScope;
39ScopedSocket.prototype.emit = function(event, data, callback) {
40  var socket = this.socket;
41  var $rootScope = this.$rootScope;
52
53angular.module('insight.socket').factory('getSocket',
54  function($rootScope) {
59    return function(scope) {
60      var scopedSocket = new ScopedSocket(socket, $rootScope);
61      scope.$on('$destroy', function() {
socket.h https://github.com/Shopify/ipxe.git | C++ Header | 147 lines
1#ifndef _IPXE_SOCKET_H
2#define _IPXE_SOCKET_H
5 *
6 * Socket addresses
7 *
44static inline __attribute__ (( always_inline )) const char *
45socket_semantics_name ( int semantics ) {
46	/* Cannot use a switch() because of the {TCP_UDP}_SOCK_XXX hack */
74static inline __attribute__ (( always_inline )) const char *
75socket_family_name ( int family ) {
76	switch ( family ) {
83
84/** A socket address family */
85typedef uint16_t sa_family_t;
90/**
91 * Generalized socket address structure
92 *
socket.io.d.ts https://github.com/vilic/DefinitelyTyped.git | TypeScript | 79 lines
1// Type definitions for socket.io 1.2.0
2// Project: http://socket.io/
14interface SocketIOStatic {
15    (): SocketIO.Server;
16    (srv: any, opts?: any): SocketIO.Server;
16    (srv: any, opts?: any): SocketIO.Server;
17    (port: number, opts?: any): SocketIO.Server;
18    (opts: any): SocketIO.Server;
19
20    listen: SocketIOStatic;
21}
39
40        on(event: 'connection', listener: (socket: Socket) => void): any;
41        on(event: 'connect', listener: (socket: Socket) => void): any;
50        on(event: 'connection', listener: (socket: Socket) => void): any;
51        on(event: 'connect', listener: (socket: Socket) => void): any;
52        on(event: string, listener: Function): any;
socket.io-0.9.d.ts https://github.com/vilic/DefinitelyTyped.git | TypeScript | 71 lines
12	export function listen(server: http.Server, options: any, fn: Function): SocketManager;
13	export function listen(server: http.Server, fn?: Function): SocketManager;
14	export function listen(port: Number): SocketManager;
34    emit(ev: any, ...data:any[]): Socket;
35    on(ns: string, fn: Function): Socket;
36  }
44    in(room: string): SocketNamespace;
45    on(evt: string, fn: (socket: Socket) => void): SocketNamespace;
46    to(room: string): SocketNamespace;
49    emit(ev: any, ...data:any[]): Socket;
50    socket(sid: any, readable: boolean): Socket;
51    authorization(fn: Function): SocketNamespace;
64    on(ns: string, fn: Function): SocketManager;
65    sockets: SocketNamespace;
66  }
dojox.socket.d.ts https://github.com/vilic/DefinitelyTyped.git | TypeScript | 62 lines
9     *
10     * Provides a simple socket connection using WebSocket, or alternate
11     * communication mechanisms in legacy browsers for comet-style communication. This is based
11     * communication mechanisms in legacy browsers for comet-style communication. This is based
12     * on the WebSocket API and returns an object that implements the WebSocket interface:
13     * http://dev.w3.org/html5/websockets/#websocket
22         * object implementing the WebSocket interface:
23         * http://dev.w3.org/html5/websockets/#websocket
24         * 
33         */
34        interface replace{(socket: any, newSocket: any, listenForOpen: any): void}
35        /**
46         * 
47         * @param socket Socket to add reconnection support to.     
48         * @param options     
socket.js https://github.com/ajaylbsim/Me-You.git | JavaScript | 155 lines
4    var socketsOfClients = {};
5    io.sockets.on('connection', function (socket) {
6        socket.on('set username', function (userId) {
77        Object.keys(socketsOfClients).forEach(function (sId) {
78            io.sockets.sockets[sId].emit('userJoined', { "userId": uName, "userList": socketsOfClients});
79        })
106                    }
107                    io.sockets.sockets[sId].emit('updateFrindsList', {"userList": friends[0].friends});
108
124            console.log('Sending welcome msg to ' + uName + ' at ' + sId);
125            io.sockets.sockets[sId].emit('welcome', { "userId": uName, "currentUsers": JSON.stringify(Object.keys(clients)) });
126
131        setTimeout(function () {
132            io.sockets.sockets[sId].emit('error', { "userIdInUse": true });
133        }, 500);
socket.c https://github.com/smuehlmann/xbmc-pvr-addons.git | C | 3,107 lines
20/*
21 * socket.c - functions to handle low level socket interactions with a
22 *            MythTV frontend.
134 * Receive the <length> portion of a MythTV Protocol message
135 * on the socket specified by 'conn'
136 *
281 * string: []:[] or terminated by running out of message.  Up to
282 * 'count' Bytes will be consumed from the socket specified by 'conn'
283 * (stopping when a separator is seen or 'count' is exhausted).  Of
435 * running out of message.  Up to 'count' Bytes will be consumed from
436 * the socket specified by 'conn' (stopping when a separator is seen
437 * or 'count' is exhausted).  The unsigned long long integer value of
1151 * running out of message.  Up to 'count' Bytes will be consumed from
1152 * the socket specified by 'conn' (stopping when a separator is seen
1153 * or 'count' is exhausted).  The unsigned short integer value of the
socket.c https://github.com/mchaland/libusbmuxd.git | C | 436 lines
1/*
2 * socket.c
3 *
34#else
35#include <sys/socket.h>
36#include <sys/un.h>
40#endif
41#include "socket.h"
42
46
47void socket_set_verbose(int level)
48{
52#ifndef WIN32
53int socket_create_unix(const char *filename)
54{
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21