PageRenderTime 17ms queryFilters 2ms Sphinxql 436ms GetByIds 66ms meta 0ms repositoryFilters 11ms languageFilters 2ms sourceFilters 2ms

1,422,939 results for 'socket repo:danski/squeenote-qunit' (17 ms)

Source

Language

Repository

socket.rb https://github.com/anselmo/god.git | Ruby | 96 lines
5  # The God::Server oversees the DRb server which dishes out info on this God daemon.
6  class Socket
7    attr_reader :port
12    # Returns String (file location)
13    def self.socket_file(port)
14      "/tmp/god.#{port}.sock"
16    
17    # The address of the socket for a given port
18    #   +port+ is the port number
20    # Returns String (drb address)
21    def self.socket(port)
22      "drbunix://#{self.socket_file(port)}"
84          end
85          abort "Socket #{self.socket} already in use by another instance of god"
86        rescue StandardError, Timeout::Error
socket.js https://github.com/jojo1311/youtube-remote-js.git | JavaScript | 51 lines
5
6function init(socket, data){
7	var id = uuid.v4();
8	console.log('assign uuid %s to socket', id);
9	clients[id] = {id: uuid, socket: socket};
10	socket.uuid = id;
10	socket.uuid = id;
11	socket.on('cmd', function(data){
12		process.emit('socket.'+data.cmd, data);
13	});
14	socket.emit('response', {action: 'uuid', uuid: id});
15}
43	onDisconnect: function(session, socket) {
44		console.log('socket disconnected %s', socket.uuid);
45		delete clients[socket.uuid];
socket.cpp https://github.com/charlieyqin/development_misc.git | C++ | 250 lines
75
76Socket::Socket(const Socket& o) {
77  refCounter_=o.refCounter_;
83
84Socket& Socket::operator=(Socket& o) {
85  (*o.refCounter_)++;
159
160SocketServer::SocketServer(int port, int connections, TypeSocket type) {
161  sockaddr_in sa;
201
202SocketClient::SocketClient(const std::string& host, int port) : Socket() {
203  std::string error;
222
223SocketSelect::SocketSelect(Socket const * const s1, Socket const * const s2, TypeSocket type) {
224  FD_ZERO(&fds_);
socket.h https://github.com/gusvielite/Arduino.git | C++ Header | 107 lines
1/*
2  socket.h - Library for Arduino Wifi shield.
3  Copyright (c) 2011-2014 Arduino.  All right reserved.
26
27#ifndef	_SOCKET_H_
28#define	_SOCKET_H_
29
30#define TCP_SOCKET  1
31#define UDP_SOCKET  2
31#define UDP_SOCKET  2
32#define RAW_SOCKET  3
33
93
94extern SOCKET socket(uint8 protocol); // Opens a socket(TCP or UDP or IP_RAW mode)
95extern void close(SOCKET s); // Close socket
socket.c https://github.com/gusvielite/Arduino.git | C | 40 lines
1/*
2  socket.c - Library for Arduino Wifi shield.
3  Copyright (c) 2011-2014 Arduino.  All right reserved.
22@file		socket.c
23@brief	define function of socket API 
24*
26#include <inttypes.h>
27#include "socket.h"
28
28
29SOCKET socket(uint8 protocol) {return 0;} // Opens a socket(TCP or UDP or IP_RAW mode)
30void close(SOCKET s) {} // Close socket
30void close(SOCKET s) {} // Close socket
31uint8 connect(SOCKET s, uint8 * addr, uint16 port) {return 0;} // Establish TCP connection (Active connection)
32void disconnect(SOCKET s) {} // disconnect the connection
Socket.cc https://github.com/my4ndr0id/android_external_alljoyn_common.git | C++ | 1,106 lines
60    int disableSigPipe = 1;
61    setsockopt(socket, SOL_SOCKET, SO_NOSIGPIPE, &disableSigPipe, sizeof(disableSigPipe));
62}
163
164QStatus Socket(AddressFamily addrFamily, SocketType type, SocketFd& sockfd)
165{
328
329QStatus Accept(SocketFd sockfd, IPAddress& remoteAddr, uint16_t& remotePort, SocketFd& newSockfd)
330{
411
412QStatus SocketDup(SocketFd sockfd, SocketFd& dupSock)
413{
826
827QStatus SocketPair(SocketFd(&sockets)[2])
828{
socket.io-client-tests.ts https://github.com/vilic/DefinitelyTyped.git | TypeScript | 58 lines
1/// <reference path="socket.io-client.d.ts"/>
2
3function testUsingWithNodeHTTPServer() {
4    var socket = io('http://localhost');
5    socket.on('news', function (data: any) {
6        console.log(data);
7        socket.emit('my other event', { my: 'data' });
8    });
11function testUsingWithExpress() {
12    var socket = io.connect('http://localhost');
13    socket.on('news', function (data: any) {
14        console.log(data);
15        socket.emit('my other event', { my: 'data' });
16    });
19function testUsingWithTheExpressFramework() {
20    var socket = io.connect('http://localhost');
21    socket.on('news', function (data: any) {
socket.h https://github.com/abzman/arduino-libraries.git | C++ Header | 47 lines
1/*
2socket.h - network socket class 
3
21#ifndef	_socket_h_
22#define	_socket_h_
23
25
26extern uint8_t socket(SOCKET s, uint8_t protocol, uint16_t port, uint8_t flag); // Opens a socket(TCP or UDP or IP_RAW mode)
27extern void close(SOCKET s); // Close socket
27extern void close(SOCKET s); // Close socket
28extern uint8_t listen(SOCKET s);	// Establish TCP connection (Passive connection)
29extern uint16_t recv(SOCKET s, uint8_t * buf, uint16_t len);    // Receive data (TCP)
31extern uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len); // Send data (TCP)
32extern uint8_t connect(SOCKET s, String addr, String port);
33
Socket.cpp https://github.com/smuehlmann/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;
Socket.html https://github.com/vladimirivanov91/jboss-soe.git | HTML | 337 lines
5<!-- Generated by javadoc (version 1.7.0_03) on Tue May 22 06:24:53 CEST 2012 -->
6<title>Socket (Apache Ant API)</title>
7<meta name="date" content="2012-05-22">
42<li><a href="../../../../../../index.html?org/apache/tools/ant/taskdefs/condition/Socket.html" target="_top">Frames</a></li>
43<li><a href="Socket.html" target="_top">No Frames</a></li>
44</ul>
81<div class="subTitle">org.apache.tools.ant.taskdefs.condition</div>
82<h2 title="Class Socket" class="title">Class Socket</h2>
83</div>
91<ul class="inheritance">
92<li>org.apache.tools.ant.taskdefs.condition.Socket</li>
93</ul>
147<tr class="altColor">
148<td class="colOne"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/condition/Socket.html#Socket()">Socket</a></strong>()</code>&nbsp;</td>
149</tr>
socket.go https://github.com/courtf/geobin.io.git | Go | 196 lines
51
52// NewSocket upgrades an existing TCP connection to a websocket connection in response to a client request for a websocket.
53// `name` here is just an identifying string for the socket, which will be returned when/if the socket is closed
59// If you do not care about these callbacks, pass nil instead.
60func NewSocket(name string, w http.ResponseWriter, r *http.Request, or func(int, []byte), oc func(string)) (Socket, error) {
61	ws, err := websocket.Upgrade(w, r, nil, 1024, 1024)
73// NewClient creates a client web socket connection to the host running at the provided URL.
74// `name` here is just an identifying string for the socket, which will be returned when/if the socket is closed
75// by calling a provided function (settable with `SetOnClose()`).
80// If you do not care about these callbacks, pass nil instead.
81func NewClient(name string, socketURL string, or func(int, []byte), oc func(string)) (Socket, error) {
82	u, err := url.Parse(socketURL)
102
103func socketSetup(name string, ws *websocket.Conn, or func(int, []byte), oc func(string)) Socket {
104	if or == nil {
netlink-socket.c https://github.com/kevinfhell/dpdk-ovs.git | C | 1,220 lines
17#include <config.h>
18#include "netlink-socket.h"
19#include <errno.h>
33#include "poll-loop.h"
34#include "socket-util.h"
35#include "util.h"
37
38VLOG_DEFINE_THIS_MODULE(netlink_socket);
39
59
60/* Netlink sockets. */
61
82
83/* Creates a new netlink socket for the given netlink 'protocol'
84 * (NETLINK_ROUTE, NETLINK_GENERIC, ...).  Returns 0 and sets '*sockp' to the
socket.h https://github.com/bossjones/pwntools.git | C++ Header | 547 lines
1#ifndef _SYS_SOCKET_H
2#define _SYS_SOCKET_H
10#if defined(__alpha__) || defined(__mips__)
11#define SOL_SOCKET	0xffff
12
46#elif defined(__hppa__)
47#define SOL_SOCKET	0xffff
48
84
85/* Socket filtering */
86#define SO_ATTACH_FILTER	0x401a
91#elif defined(__sparc__)
92#define SOL_SOCKET	0xffff
93
134
135#define SOL_SOCKET	1
136
agent-destroyed-socket.t https://github.com/mamod/Rum.git | Unknown | 113 lines
19
20my $agent = $http->{Agent}->new({maxSockets => 1});
21
23    my ($this, $socket, $host, $port) = @_;
24    debug('freeing socket. destroyed? ', $socket->{destroyed});
25});
52        #//
53        #// It is possible for the socket to get destroyed and other work
54        #// to run before the 'close' event fires because it happens on
68                #since it was destroyed.
69                ok($request1->{socket} != $request2->{socket});
70                ok(!$request2->{socket}->{destroyed}, 'the socket is destroyed');
83    # assert not reusing the same socket, since it was destroyed.
84    ok($request1->{socket} != $request2->{socket});
85    debug('got response2');
socket.monkey https://github.com/Sonickidnextgen/monkey_ambiguityfix_80a.git | Unknown | 591 lines
147
148	Method New( socket:BBSocket,host:String,port:Int,onComplete:IOnBindComplete )
149		_socket=socket
238
239	Method New( socket:BBSocket,data:DataBuffer,offset:Int,count:Int,address:SocketAddress,onComplete:IOnSendToComplete )
240		Super.New( socket,data,offset,count )
306
307	Method New( socket:BBSocket,data:DataBuffer,offset:Int,count:Int,address:SocketAddress,onComplete:IOnReceiveFromComplete )
308		Super.New( socket,data,offset,count )
337Interface IOnAcceptComplete
338	Method OnAcceptComplete:Void( socket:Socket,source:Socket )
339End
586	Method OnAcceptComplete:Socket()
587		Return New Socket( _sock.Accepted(),Socket.STREAM,Socket.OPEN|Socket.BOUND|Socket.CONNECTED )
588	End
Socket.php https://github.com/MichalWadowski/cakephp.git | PHP | 384 lines
20/**
21 * CakePHP network socket connection class.
22 *
34 */
35	public $description = 'Remote DataSource Network Socket Interface';
36
37/**
38 * Default configuration settings for the socket connection
39 *
50/**
51 * Reference to socket connection resource
52 *
71/**
72 * True if the socket stream is encrypted after a Cake\Network\Socket::enableCrypto() call
73 *
socket.cpp https://github.com/llvm-djk/mordor.git | C++ | 2,002 lines
114        WSAStartup(MAKEWORD(2,2), &wd);
115        socket_t sock = socket(AF_INET, SOCK_STREAM, 0);
116        DWORD bytes = 0;
207
208Socket::Socket(int family, int type, int protocol)
209: m_sock(-1),
583void
584Socket::accept(Socket &target)
585{
1679{
1680    return Socket::ptr(new Socket(family(), type, protocol));
1681}
1685{
1686    return Socket::ptr(new Socket(ioManager, family(), type, protocol));
1687}
socket.cc https://github.com/scarletttu/ns-3-codel-dev.git | C++ | 522 lines
60  NS_ASSERT (node != 0);
61  Ptr<SocketFactory> socketFactory = node->GetObject<SocketFactory> (tid);
62  NS_ASSERT (socketFactory != 0);
105void
106Socket::SetSendCallback (Callback<void, Ptr<Socket>, uint32_t> sendCb)
107{
259void 
260Socket::NotifyNewConnectionCreated (Ptr<Socket> socket, const Address &from)
261{
356
357SocketAddressTag::SocketAddressTag ()
358{
464
465SocketSetDontFragmentTag::SocketSetDontFragmentTag ()
466{
tcp-socket-base.h https://github.com/scarletttu/ns-3-codel-dev.git | C++ Header | 243 lines
20 */
21#ifndef TCP_SOCKET_BASE_H
22#define TCP_SOCKET_BASE_H
59 */
60class TcpSocketBase : public TcpSocket
61{
71   */
72  TcpSocketBase (const TcpSocketBase& sock);
73  virtual ~TcpSocketBase (void);
81  virtual enum SocketErrno GetErrno (void) const;    // returns m_errno
82  virtual enum SocketType GetSocketType (void) const; // returns socket type
83  virtual Ptr<Node> GetNode (void) const;            // returns m_node
225  TracedValue<TcpStates_t> m_state;         //< TCP state
226  enum SocketErrno         m_errno;         //< Socket error code
227  bool                     m_closeNotified; //< Told app to close socket
lm-old-socket.c https://github.com/mhallendal/loudmouth.git | C | 1,064 lines
91
92static void         socket_free                    (LmOldSocket    *socket);
93static gboolean     socket_do_connect              (LmConnectData  *connect_data);
142static gint
143old_socket_do_write (LmOldSocket *socket, const gchar *buf, guint len)
144{
1036void
1037lm_old_socket_asyncns_cancel (LmOldSocket *socket)
1038{
1046gboolean
1047lm_old_socket_get_use_starttls (LmOldSocket *socket)
1048{
1056gboolean
1057lm_old_socket_get_require_starttls (LmOldSocket *socket)
1058{
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21