PageRenderTime 2100ms queryFilters 0ms Sphinxql 495ms GetByIds 1577ms meta 0ms repositoryFilters 5ms languageFilters 5ms sourceFilters 1ms

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

Source

Language

Repository

socket.js https://github.com/prodigeni/vock.git | JavaScript | 236 lines
9
10var socket = exports;
11
13// ### function Socket (options)
14// #### @options {Object} Socket options
15// msgpack encoder/decoder wrapper over udp socket
16//
17function Socket(options) {
18  EventEmitter.call(this);
19
20  this.tsocket = null;
21  this.socket = null;
82
83    self.socket = dgram.createSocket('udp4');
84    self.socket.on('message', self.ondata.bind(self));
socket-util.c https://github.com/kevinfhell/dpdk-ovs.git | C | 1,396 lines
17#include <config.h>
18#include "socket-util.h"
19#include <arpa/inet.h>
30#include <sys/resource.h>
31#include <sys/socket.h>
32#include <sys/stat.h>
46#include "netlink-protocol.h"
47#include "netlink-socket.h"
48#endif
49
50VLOG_DEFINE_THIS_MODULE(socket_util);
51
274
275/* Drain all the data currently in the receive queue of a datagram socket (and
276 * possibly additional data).  There is no way to know how many packets are in
socket.c https://github.com/wuyohee2004/learn.git | C | 727 lines
13
14static struct socket *g_sock_fds[MAX_SOCK_NUM];
15
527
528struct socket *tcp_search_socket(const struct tcp_header *tcp_pkt, const struct ip_header *ip_pkt)
529{
595
596struct socket *udp_search_socket(const struct udp_header *udp_pkt, const struct ip_header *ip_pkt)
597{
664
665struct socket *icmp_search_socket(const struct ping_packet *ping_pkt, const struct ip_header *ip_pkt)
666{
704
705struct socket *arp_search_socket(const struct arp_packet *arp_pkt)
706{
netlink-socket.c https://github.com/noironetworks/ovs.git | C | 1,818 lines
17#include <config.h>
18#include "netlink-socket.h"
19#include <errno.h>
77
78/* Netlink sockets. */
79
106
107/* Creates a new netlink socket for the given netlink 'protocol'
108 * (NETLINK_ROUTE, NETLINK_GENERIC, ...).  Returns 0 and sets '*sockp' to the
378#ifdef _WIN32
379    /* Set the socket type as a "multicast" socket */
380    sock->read_ioctl = OVS_IOCTL_READ_EVENT;
1106            /* Take the mutex here to avoid an in-kernel race.  If two threads
1107             * try to read from a Netlink dump socket at once, then the socket
1108             * error can be set to EINVAL, which will be encountered on the
socket.h https://github.com/hbfs/Rockchip-GPL-Kernel.git | C++ Header | 287 lines
1/* Declarations of socket constants, types, and functions.
2   Copyright (C) 1991,92,1994-2001,2003,2005,2007,2008,2012
19
20#ifndef	_SYS_SOCKET_H
21#define	_SYS_SOCKET_H	1
38   `struct msghdr', and `struct linger' types.  */
39#include <bits/socket.h>
40
62
63/* This is the type we use for generic socket address arguments.
64
110
111/* Create a new socket of type TYPE in domain DOMAIN, using
112   protocol PROTOCOL.  If PROTOCOL is zero, one is chosen automatically.
112   protocol PROTOCOL.  If PROTOCOL is zero, one is chosen automatically.
113   Returns a file descriptor for the new socket, or -1 for errors.  */
114extern int socket (int __domain, int __type, int __protocol) __THROW;
Socket.java https://github.com/innerverse/java-service.git | Java | 189 lines
31import java.net.InetAddress;
32import java.net.SocketAddress;
33import java.net.SocketException;
41 */
42public interface Socket<X> {
43
47	 * 		<code>true</code> to enable TCP_NODELAY, <code>false</code> to disable. 
48	 * @throws SocketException
49	 * 		if there is an error in the underlying protocol, such as a TCP error.
135	 */
136	public SocketAddress getLocalSocketAddress();
137
144	 */
145	public SocketAddress getRemoteSocketAddress();
146	
socket.io.js https://github.com/DerGuteMoritz/pubnub-api.git | JavaScript | 250 lines
3    // =====================================================================
4    // PubNub Socket.IO
5    // =====================================================================
24            ,   namespace = urlbits[3] || standard
25            ,   socket    = create_socket(namespace);
26
30            // PUBNUB ALREADY SETUP?
31            if (io.connected) return socket;
32            io.connected = true;
86                            last      : now(),
87                            socket    : socket,
88                            namespace : ns,
157
158        return 'password' in socket && socket.password && sjcl.encrypt(
159           socket.password, JSON.stringify(data)+''
Socket.h https://github.com/chaoswork/httpServer.git | C++ Header | 77 lines
43using std::string;
44/* Socket is class to handle socket,can't copy publicly.
45 * With the action connect,close,and server action bind,
50public:
51	explicit Socket(SOCKET sk=-1);
52	Socket(int af,int type,int protocol=0);
62	/* Socket i/o stream */
63	SocketStream getSocketStream();
64protected:
67	 * as private,and also disallow the operator= used public*/
68	Socket(const Socket& SK){m_socket=SK.m_socket;}
69	Socket& operator=(const Socket&);
70private:
71	//SOCKET m_socket;
72	int m_socket;
socket.lua https://github.com/huigenius/skynet.git | Lua | 190 lines
1local buffer = require "socketbuffer"
2local skynet = require "skynet"
102
103local socket = {}
104
104
105function socket.open(addr, port)
106	local cmd = "open" .. " " .. (port and (addr..":"..port) or addr)
106	local cmd = "open" .. " " .. (port and (addr..":"..port) or addr)
107	local r = skynet.call(".socket", "text", cmd)
108	if r == "" then
113
114function socket.stdin()
115	local r = skynet.call(".socket", "text", "bind 1")
121
122function socket.close(fd)
123	socket.lock(fd)
socket.js https://github.com/juliankrispel/node-chat.git | JavaScript | 55 lines
3
4var sockets = {};
5
17        var that = this;
18        this.io.sockets.on('connection', function (socket) {
19            //Store socket in object
19            //Store socket in object
20            sockets[socket.id] = socket;
21
27    closeSocket: function(id){
28        var socket = sockets[id];
29        socket.emit('Insufficient Credentials');
44        socket.on('disconnect', function () {
45            that.emit('socket_disconnect', socket.id);
46        });
Socket-Addresses.html https://github.com/apc-io/apc-rock-toolchain.git | HTML | 102 lines
2<head>
3<title>Socket Addresses - The GNU C Library</title>
4<meta http-equiv="Content-Type" content="text/html">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Sockets.html#Sockets" title="Sockets">
9<link rel="prev" href="Communication-Styles.html#Communication-Styles" title="Communication Styles">
53Previous:&nbsp;<a rel="previous" accesskey="p" href="Communication-Styles.html#Communication-Styles">Communication Styles</a>,
54Up:&nbsp;<a rel="up" accesskey="u" href="Sockets.html#Sockets">Sockets</a>
55<hr>
59
60<p><a name="index-address-of-socket-1651"></a><a name="index-name-of-socket-1652"></a><a name="index-binding-a-socket-address-1653"></a><a name="index-socket-address-_0028name_0029-binding-1654"></a>The name of a socket is normally called an <dfn>address</dfn>.  The
61functions and symbols for dealing with socket addresses were named
65
66   <p>A socket newly created with the <code>socket</code> function has no
67address.  Other processes can find it for communication only if you
066-socket-receiveuntil.t https://github.com/liyao0409/tengine.git | Unknown | 1,334 lines
3use lib 'lib';
4use Test::Nginx::Socket;
5
28        content_by_lua '
29            local sock = ngx.socket.tcp()
30            local port = ngx.var.port
80        content_by_lua '
81            local sock = ngx.socket.tcp()
82            local port = ngx.var.port
149        content_by_lua '
150            local sock = ngx.socket.tcp()
151            local port = ngx.var.port
219
220            local sock = ngx.socket.tcp()
221            local port = ngx.var.port
Socket.cpp https://github.com/jzeaherra/xbmc-pvr-addons.git | C++ | 773 lines
34
35Socket::Socket(const enum SocketFamily family, const enum SocketDomain domain, const enum SocketType type, const enum SocketProtocol protocol)
36{
45
46Socket::Socket()
47{
190
191bool Socket::accept ( Socket& new_socket ) const
192{
574  case WSAENOTSOCK:
575    errmsg = "Socket operation on nonsocket";
576    break;
679  {
680    XBMC->Log(LOG_ERROR, "Socket::set_non_blocking - Can't set socket flags to: %i", opts);
681    return false;
socket.js https://github.com/rberger/kippt-chrome.git | JavaScript | 151 lines
1/*
2 * Chrome Extension Socket
3 * <https://github.com/jjNford/chrome-extension-socket>
73
74	window.Socket = {
75
84				if(port.name === "down") {
85					Socket.port = chrome.extension.connect({name: "up"});
86				}				
87				port.onMessage.addListener( function(msg) {
88					Socket.onMessage(msg);
89				});				
89				});				
90				Socket.port.onDisconnect.addListener( function(port) {
91					port.onMessage.removeListener();
socket.js https://github.com/lucciano/zerorpc-node.git | JavaScript | 145 lines
36//      The underlying ZeroMQ socket to use
37function Socket(zmqSocket) {
38    var self = this;
38    var self = this;
39    self._zmqSocket = zmqSocket;
40    util.eventProxy(self._zmqSocket, self, "error");
71    var message = events.serialize(event);
72    this._zmqSocket.send.call(this._zmqSocket, message);
73};
110
111nodeUtil.inherits(MultiplexingSocket, Socket);
112
135function server() {
136    return new MultiplexingSocket(zmq.socket("xrep"));
137}
socket.c https://github.com/TyRoXx/webserver.git | C | 171 lines
13#ifdef WS_WIN32
14static const socket_t InvalidSocket = INVALID_SOCKET;
15typedef int socket_size_t;
54
55void socket_destroy(socket_t socket)
56{
64
65bool socket_bind(socket_t socket, uint16_t port)
66{
76
77bool socket_accept(socket_t socket, socket_t *accepted, socket_address_t *address)
78{
142
143void socket_shutdown(socket_t socket)
144{
Socket.cpp https://github.com/xhaggi/xbmc-pvr-addons.git | C++ | 726 lines
35
36Socket::Socket(const enum SocketFamily family, const enum SocketDomain domain, const enum SocketType type, const enum SocketProtocol protocol)
37{
46
47Socket::Socket()
48{
174
175bool Socket::accept ( Socket& new_socket ) const
176{
524  case WSAENOTSOCK:
525    errmsg = "Socket operation on nonsocket";
526    break;
629  {
630    XBMC->Log(LOG_ERROR, "Socket::set_non_blocking - Can't set socket flags to: %i", opts);
631    return false;
066-socket-receiveuntil.t https://github.com/npk/lua-nginx-module.git | Unknown | 1,333 lines
3use lib 'lib';
4use Test::Nginx::Socket;
5
29        content_by_lua '
30            local sock = ngx.socket.tcp()
31            local port = ngx.var.port
81        content_by_lua '
82            local sock = ngx.socket.tcp()
83            local port = ngx.var.port
150        content_by_lua '
151            local sock = ngx.socket.tcp()
152            local port = ngx.var.port
220
221            local sock = ngx.socket.tcp()
222            local port = ngx.var.port
socket.js https://github.com/astro/bitford.git | JavaScript | 224 lines
1var Socket = chrome.socket || chrome.experimental.socket;
2
67
68/* Creates paused sockets */
69function createTCPServer(host, port, acceptCb, listenCb) {
120    Socket.create('tcp', {}, function(createInfo) {
121	var sock = new TCPSocket(createInfo.socketId);
122	sock.connect(host, port, function(err) {
136TCPSocket.prototype = Object.create(BaseSocket.prototype);
137TCPSocket.prototype.constructor = TCPSocket;
138
174    Socket.create('udp', {}, function(createInfo) {
175	var sock = new UDPSocket(createInfo.socketId);
176	sock.connect(host, port, function(err) {
190UDPSocket.prototype = Object.create(BaseSocket.prototype);
191UDPSocket.prototype.constructor = UDPSocket;
192
Socket.h https://github.com/wyrover/TideSDK.git | C++ Header | 356 lines
21
22#ifndef _SOCKET_UTILS_H_
23#define _SOCKET_UTILS_H_
38	template <class T>
39	class Socket
40		: public StaticBoundObject
66		{
67			return tide::Logger::Get("Socket.TCPSocket");
68		}
119	template <class T>
120	Socket<T>::Socket(Host *host, const std::string & name)
121		: StaticBoundObject(name.c_str()),
138	template <class T>
139	Socket<T>::~Socket()
140	{
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21