PageRenderTime 27ms queryFilters 2ms Sphinxql 427ms GetByIds 97ms meta 0ms repositoryFilters 7ms languageFilters 7ms sourceFilters 2ms

1,422,939 results for 'socket repo:mba811/twenty' (27 ms)

Source

Language

Repository

socket.rb git://github.com/rhomobile/rhodes.git | Ruby | 871 lines
432  #   # tcp_server_sockets returns two sockets.
433  #   sockets = Socket.tcp_server_sockets(1296)
434  #   p sockets #=> [#<Socket:fd 3>, #<Socket:fd 4>]
441  #   # IPv6 and IPv4 socket has same port number, 53114, even if it is chosen dynamically.
442  #   sockets = Socket.tcp_server_sockets(0)
443  #   sockets.each {|s| p s.local_address }
447  #   # The block is called with the sockets.
448  #   Socket.tcp_server_sockets(0) {|sockets|
449  #     p sockets #=> [#<Socket:fd 3>, #<Socket:fd 4>]
575  #   # UDP/IP echo server
576  #   Socket.udp_server_sockets(0) {|sockets|
577  #     p sockets.first.local_address.ip_port     #=> 32963
797  #
798  #   socket = Socket.unix_server_socket("/tmp/s")
799  #   p socket                  #=> #<Socket:fd 3>
Socket.cs git://github.com/mono/mono.git | C# | 10,332 lines
1287
1288            Socket socket = CreateAcceptSocket(acceptedSocketHandle, m_RightEndPoint.Create(socketAddress), false);
1289            if (s_LoggingEnabled) {
1289            if (s_LoggingEnabled) {
1290                Logging.PrintInfo(Logging.Sockets, socket, SR.GetString(SR.net_log_socket_accepted, socket.RemoteEndPoint, socket.LocalEndPoint));
1291                Logging.Exit(Logging.Sockets, this, "Accept", socket);
5678            {
5679                GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::EndAccept() SRC:" + ValidationHelper.ToString(LocalEndPoint) + " acceptedSocket:" + ValidationHelper.HashString(socket) + " acceptedSocket.SRC:" + ValidationHelper.ToString(socket.LocalEndPoint) + " acceptedSocket.DST:" + ValidationHelper.ToString(socket.RemoteEndPoint) + " bytesTransferred:" + bytesTransferred.ToString());
5680            }
5684            if (s_LoggingEnabled) {
5685                Logging.PrintInfo(Logging.Sockets, socket, SR.GetString(SR.net_log_socket_accepted, socket.RemoteEndPoint, socket.LocalEndPoint));
5686                Logging.Exit(Logging.Sockets, this, "EndAccept", socket);
9844                    if(socketError == SocketError.Success) {
9845                        m_AcceptSocket = m_CurrentSocket.UpdateAcceptSocket(m_AcceptSocket, m_CurrentSocket.m_RightEndPoint.Create(remoteSocketAddress), false);
9846
Thrift.Socket.pas git://github.com/apache/thrift.git | Pascal | 1,617 lines
207    // The underlying socket descriptor
208    property Socket: Winapi.Winsock2.TSocket read FSocket write SetSocket;
209  end;
621
622procedure TBaseSocket.SetSocket(ASocket: Winapi.Winsock2.TSocket);
623begin
925
926constructor TSocket.Create(ASocket: Winapi.Winsock2.TSocket; ALogDelegate: TBaseSocket.TLogDelegate);
927begin
931
932constructor TSocket.Create(ASocket: Winapi.Winsock2.TSocket; AInterruptListener: ISmartPointer<Winapi.Winsock2.TSocket>;
933  ALogDelegate: TBaseSocket.TLogDelegate);
1232
1233function TServerSocket.CreateSocketObj(Client: Winapi.Winsock2.TSocket): TSocket;
1234begin
socket.py git://github.com/qgis/Quantum-GIS.git | Python | 455 lines
7On other systems, it only supports IP. Functions specific for a
8socket are available as methods of the socket object.
9
11
12socket() -- create a new socket object
13socketpair() -- create a pair of new socket objects [*]
92
93class socket(_socket.socket):
94
235
236if hasattr(_socket.socket, "share"):
237    def fromshare(info):
247    def socketpair(family=None, type=SOCK_STREAM, proto=0):
248        """socketpair([family[, type[, proto]]]) -> (socket object, socket object)
249
socket.go git://github.com/bradfitz/camlistore.git | Go | 656 lines
278	}
279	debugf("Socket %p to %s: updated %s deadline to %s ahead (%s)", socket, socket.addr, whichstr, socket.timeout, when)
280}
289	if socket.dead != nil {
290		debugf("Socket %p to %s: killed again: %s (previously: %s)", socket, socket.addr, err.Error(), socket.dead.Error())
291		socket.Unlock()
303	for _, f := range replyFuncs {
304		logf("Socket %p to %s: notifying replyFunc of closed socket: %s", socket, socket.addr, err.Error())
305		f(err, nil, -1, nil)
363			}
364			debugf("Socket %p to %s: serializing update document: %#v", socket, socket.addr, op.update)
365			buf, err = addBSON(buf, op.update)
445		socket.Unlock()
446		debugf("Socket %p to %s: failing query, already closed: %s", socket, socket.addr, socket.dead.Error())
447		// XXX This seems necessary in case the session is closed concurrently
Socket.SocketInterfaces.cs https://gadgeteer.svn.codeplex.com/svn | C# | 731 lines
90                                    if (socket.AnalogInput3 == Cpu.AnalogChannel.ANALOG_NONE || socket.AnalogInput4 == Cpu.AnalogChannel.ANALOG_NONE || socket.AnalogInput5 == Cpu.AnalogChannel.ANALOG_NONE) SocketRegistrationError(socket, "Socket of type A must support analog input functionality on pins 3, 4 and 5");
91                                    if (socket.AnalogInputScale == double.MinValue || socket.AnalogInputOffset == double.MinValue || socket.AnalogInputPrecisionInBits == int.MinValue) SocketRegistrationError(socket, "Socket of type A must provide analog input scale/offset through calling SocketInterfaces.SetAnalogInputFactors");
92                                }
126                                {
127                                    if (socket.PWM7 == Cpu.PWMChannel.PWM_NONE || socket.PWM8 == Cpu.PWMChannel.PWM_NONE || socket.PWM9 == Cpu.PWMChannel.PWM_NONE) SocketRegistrationError(socket, "Socket of type P must support PWM functionality");
128                                }
133                                {
134                                    if (socket.SPIModule == Socket.SocketInterfaces.SPIMissing) SocketRegistrationError(socket, "Socket of type S must specify SPI module number");
135                                }
178                {
179                    if (Socket.GetSocket(socket.SocketNumber, false, null, null) != null) throw new Socket.InvalidSocketException("Cannot register socket - socket number " + socket.SocketNumber + " already used");
180                    Socket._sockets.Add(socket);
687            /// <returns>An <see cref="Spi" /> interface.</returns>
688            public delegate Spi SpiIndirector(Socket socket, SpiConfiguration spiConfiguration, SpiSharing sharingMode, Socket chipSelectSocket, Socket.Pin chipSelectSocketPin, Socket busySocket, Socket.Pin busySocketPin, Module module);
689
Socket.cs https://gadgeteer.svn.codeplex.com/svn | C# | 656 lines
294        /// <returns>The socket corresponding to the provided socket number.</returns>
295        public static Socket GetSocket(int socketNumber, bool throwExceptionIfSocketNumberInvalid, Module module, string socketLabel)
296        {
304                    {
305                        throw new InvalidSocketException("Cannot get Socket for socket number Socket.NotConnected");
306                    }
324                {
325                    if (socket.SocketNumber == socketNumber) return socket;
326                }
350            this.SocketNumber = socketNumber;
351            this.CpuPins = new Cpu.Pin[11] { Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin };
352        }
586            {
587                return new InvalidSocketException("Socket " + socket + " has an error with its " + iface + " functionality. Please try a different socket.");
588            }
Socket.SocketInterfaces.cs https://gadgeteer.svn.codeplex.com/svn | C# | 222 lines
89                                    if (socket.AnalogInput3 == Cpu.AnalogChannel.ANALOG_NONE || socket.AnalogInput4 == Cpu.AnalogChannel.ANALOG_NONE || socket.AnalogInput5 == Cpu.AnalogChannel.ANALOG_NONE) SocketRegistrationError(socket, "Socket of type A must support analog input functionality on pins 3, 4 and 5");
90                                    if (socket.AnalogInputScale == double.MinValue || socket.AnalogInputOffset == double.MinValue || socket.AnalogInputPrecisionInBits == int.MinValue) SocketRegistrationError(socket, "Socket of type A must provide analog input scale/offset through calling SocketInterfaces.SetAnalogInputFactors");
91                                }
122                                    if (socket.AnalogOutput5 == Cpu.AnalogOutputChannel.ANALOG_OUTPUT_NONE) SocketRegistrationError(socket, "Socket of type O must support analog output functionality");
123                                    if (socket.AnalogOutputScale == double.MinValue || socket.AnalogOutputOffset == double.MinValue || socket.AnalogOutputPrecisionInBits == int.MinValue) SocketRegistrationError(socket, "Socket of type O must provide analog output scale/offset through calling SocketInterfaces.SetAnalogOutputFactors");
124                                }
129                                {
130                                    if (socket.PWM7 == Cpu.PWMChannel.PWM_NONE || socket.PWM8 == Cpu.PWMChannel.PWM_NONE || socket.PWM9 == Cpu.PWMChannel.PWM_NONE) SocketRegistrationError(socket, "Socket of type P must support PWM functionality");
131                                }
136                                {
137                                    if (socket.SPIModule == Socket.SocketInterfaces.SPIMissing) SocketRegistrationError(socket, "Socket of type S must specify SPI module number");
138                                }
181                {
182                    if (Socket.GetSocket(socket.SocketNumber, false, null, null) != null) throw new Socket.InvalidSocketException("Cannot register socket - socket number " + socket.SocketNumber + " already used");
183                    Socket._sockets.Add(socket);
Socket.cs https://gadgeteer.svn.codeplex.com/svn | C# | 571 lines
281        /// <returns>The socket corresponding to the provided socket number.</returns>
282        public static Socket GetSocket(int socketNumber, bool throwExceptionIfSocketNumberInvalid, Module module, string socketLabel)
283        {
291                    {
292                        throw new InvalidSocketException("Cannot get Socket for socket number Socket.NotConnected");
293                    }
312                    Socket socket = (Socket)_sockets[i];
313                    if (socket.SocketNumber == socketNumber) return socket;
314                }
338            this.SocketNumber = socketNumber;
339            this.CpuPins = new Cpu.Pin[11] { Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin, Socket.UnspecifiedPin };
340        }
535            {
536                return new InvalidSocketException("Socket " + socket + " has an error with its " + iface + " functionality. Please try a different socket.");
537            }
socket.cs https://CoolEngine.svn.codeplex.com/svn | C# | 1,716 lines
117
118                System.Net.Sockets.SocketType type = (System.Net.Sockets.SocketType)Enum.ToObject(typeof(System.Net.Sockets.SocketType), socketType);
119                if (!Enum.IsDefined(typeof(System.Net.Sockets.SocketType), type)) {
187                    List<Socket> sockets;
188                    if (handleToSocket.TryGetValue((IntPtr)socket._socket.Handle, out sockets)) {
189                        for (int i = sockets.Count-1; i >= 0; i--) {
668                    if (!handleToSocket.ContainsKey(socket._socket.Handle)) {
669                        handleToSocket[socket._socket.Handle] = new List<Socket>(1);
670                    }
670                    }
671                    handleToSocket[socket._socket.Handle].Add(socket._socket);
672                }
730                // we just use this to validate; socketType isn't actually used
731                System.Net.Sockets.SocketType socketType = (System.Net.Sockets.SocketType)Enum.ToObject(typeof(System.Net.Sockets.SocketType), socktype);
732                if (socketType == System.Net.Sockets.SocketType.Unknown || !Enum.IsDefined(typeof(System.Net.Sockets.SocketType), socketType)) {
common-socket.c git://git.minix3.org/minix | C | 2,123 lines
8#include <string.h>
9#include <sys/socket.h>
10#include <sys/stat.h>
80
81void test_socket(const struct socket_test_info *info)
82{
87
88	debug("entering test_socket()");
89
89
90	debug("Test socket() with an unsupported address family");
91
390	 * If the implementation doesn't properly free the
391	 * socket during close(), eventually socket() will
392	 * fail when the internal descriptor table is full.
socket.cpp https://bitbucket.org/dbacchet/dbsdev | C++ | 691 lines
539
540        Socket* acceptSocket = new Socket();
541        acceptSocket->_socket_handler = new_handler;
543        acceptSocket->_remote_port = get_in_port((struct sockaddr *)&incoming_addr);
544        acceptSocket->_local_port = get_local_port(acceptSocket->_socket_handler);
545        get_local_address(acceptSocket->_socket_handler, acceptSocket->_local_host);
574    {
575        Socket *socket    = new Socket();
576        strcpy(socket->_remote_host,remote_host);
602    {
603        Socket *socket = new Socket();    
604        strcpy(socket->_local_host,local_host);
629    {
630        Socket *socket    = new Socket();    
631        strcpy(socket->_remote_host,remote_host);
socket.h https://bitbucket.org/Gradwell/bind9-clone | C++ Header | 926 lines
331void
332isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp);
333/*%<
347void
348isc_socket_detach(isc_socket_t **socketp);
349/*%<
473 *
474 * \li	'socket' is a valid, bound TCP socket or a valid, bound UNIX socket.
475 *
788isc_result_t
789isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp);
790/*%<
901
902void *isc_socket_gettag(isc_socket_t *socket);
903/*%<
socket.io.js https://bitbucket.org/shinzero/betelgeuse | JavaScript | 2,236 lines
43if (typeof window != 'undefined'){
44  // WEB_SOCKET_SWF_LOCATION = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cdn.socket.io/' + this.io.version + '/WebSocketMain.swf';
45  if (typeof WEB_SOCKET_SWF_LOCATION === 'undefined')
45  if (typeof WEB_SOCKET_SWF_LOCATION === 'undefined')
46    WEB_SOCKET_SWF_LOCATION = '/socket.io/lib/vendor/web-socket-js/WebSocketMain.swf';
47}
839    // we make sure WebSocket is not confounded with a previously loaded flash WebSocket
840    return 'WebSocket' in window && WebSocket.prototype && ( WebSocket.prototype.send && !!WebSocket.prototype.send.toString().match(/native/i)) && typeof WebSocket !== "undefined";
841  };
1877  Socket.prototype.fire = Socket.prototype.emit;
1878  Socket.prototype.addListener = Socket.prototype.addEvent = Socket.prototype.addEventListener = Socket.prototype.on;
1879  Socket.prototype.removeListener = Socket.prototype.removeEventListener = Socket.prototype.removeEvent;
2109    if (!window.WEB_SOCKET_SWF_LOCATION) {
2110      console.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");
2111      return;
socket.py https://bitbucket.org/ncoghlan/cpython_sandbox | Python | 738 lines
11
12socket() -- create a new socket object
13socketpair() -- create a pair of new socket objects [*]
39
40AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
41SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)
122
123class socket(_socket.socket):
124
465    def socketpair(family=None, type=SOCK_STREAM, proto=0):
466        """socketpair([family[, type[, proto]]]) -> (socket object, socket object)
467
522
523socketpair.__doc__ = """socketpair([family[, type[, proto]]]) -> (socket object, socket object)
524Create a pair of socket objects from the sockets returned by the platform
Socket.java https://bitbucket.org/leontiad/srijan-java-app | Java | 473 lines
52  { 
53    TcpSocket newSocketEntity = new TcpSocket();
54    socketEntity = newSocketEntity.getProxy();
61  {
62    TcpSocket newSocketEntity = new TcpSocket(address, port);
63    socketEntity = newSocketEntity.getProxy();
79  {
80    TcpSocket newSocketEntity = new TcpSocket(address, port, localAddr, localPort);
81    socketEntity = newSocketEntity.getProxy();
96  {
97    TcpSocket newSocketEntity = new TcpSocket(host, port);
98    socketEntity = newSocketEntity.getProxy();
113  {
114    TcpSocket newSocketEntity = new TcpSocket(host, port, localAddr, localPort);
115    socketEntity = newSocketEntity.getProxy();
socket.txt https://bitbucket.org/mjsteger/emacsd | text | 992 lines
725
726   Send data to the socket.  The socket must be connected to a remote socket.  The
727   optional *flags* argument has the same meaning as for :meth:`recv` above.
735
736   Send data to the socket.  The socket should not be connected to a remote socket,
737   since the destination socket is specified by *address*.  The optional *flags*
869   PORT = 50007              # Arbitrary non-privileged port
870   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
871   s.bind((HOST, PORT))
887   PORT = 50007              # The same port as used by the server
888   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
889   s.connect((HOST, PORT))
977   # create a raw socket and bind it to the public interface
978   s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
979   s.bind((HOST, 0))
Socket.cs https://bitbucket.org/steenlund/mono-2.6.7-for-amiga | C# | 3,146 lines
645			 */
646			Socket [] sockets = (Socket []) list.ToArray (typeof (Socket));
647			Select_internal (ref sockets, microSeconds, out error);
682				if (mode == 1 && currentList == checkWrite && !sock.connected) {
683					if ((int) sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0)
684						sock.connected = true;
829				
830				return((int)(GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast)) != 0);
831			}
876
877				return((LingerOption)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger));
878			}
2310				 */
2311				if ((int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error) == 0) {
2312					connected = true;
socket.py https://bitbucket.org/incubaid/pylabs-core-5.1 | Python | 355 lines
75    def new(cls):
76        return cls(_socket.socket(_socket.AF_INET, _socket.SOCK_STREAM))
77
94    @classmethod
95    def from_file_descriptor(cls, fd, socket_family = _socket.AF_UNIX, socket_type = _socket.SOCK_STREAM, socket_state = STATE_INIT):
96        return cls(_socket.fromfd(fd, socket_family, socket_type), socket_state)
121    def set_reuse_address(self, reuse_address):
122        self.socket.setsockopt(_socket.SOL_SOCKET, _socket.SO_REUSEADDR, int(reuse_address))
123
127    def set_recv_buffer_size(self, n):
128        self.socket.setsockopt(_socket.SOL_SOCKET, _socket.SO_RCVBUF, n)
129
255
256    def read_socket(self, socket_class = None, socket_family =  _socket.AF_INET, socket_type = _socket.SOCK_STREAM, socket_state = STATE_INIT, timeout = TIMEOUT_CURRENT):
257        """reads a socket from this socket"""
socket.hxx https://bitbucket.org/mst/ooo340 | C++ Header | 1,131 lines
115    enum TSocketOptionLevel {
116        TLevel_Socket = osl_Socket_LevelSocket,
117        TLevel_Tcp    = osl_Socket_LevelTcp,
144        E_None              = osl_Socket_E_None,              /* no error */
145        E_NotSocket         = osl_Socket_E_NotSocket,         /* Socket operation on non-socket */
146        E_DestAddrReq       = osl_Socket_E_DestAddrReq,       /* Destination address required */
839    */
840    OStreamSocket(const OSocket& Socket);
841
970    */
971    OAcceptorSocket(const OAcceptorSocket& Socket);
972
1032    */
1033    OConnectorSocket(const OConnectorSocket& Socket);
1034
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21