100+ results results for 'socket repo:F34140r/contiki' (133 ms)
49//////////////////////////////////////////////////////////// 50SocketHandle SocketImpl::invalidSocket() 51{ 56//////////////////////////////////////////////////////////// 57void SocketImpl::close(SocketHandle sock) 58{ 63//////////////////////////////////////////////////////////// 64void SocketImpl::setBlocking(SocketHandle sock, bool block) 65{ 71//////////////////////////////////////////////////////////// 72Socket::Status SocketImpl::getErrorStatus() 73{ 82 case WSAENOTCONN: return Socket::Disconnected; 83 case WSAEISCONN: return Socket::Done; // when connecting a non-blocking socket 84 default: return Socket::Error;SocketImpl.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 39 lines
32 33 #include <SFML/Network/Win32/SocketImpl.hpp> 34 36 37 #include <SFML/Network/Unix/SocketImpl.hpp> 38ABServiceBindingWrapper.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 73 lines
36using System.Net; 37using System.Net.Sockets; 38Socks5Handler.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 278 lines
106 Bytes = null; 107 Connection.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnRecvRequest), Connection); 108 } else { 127 else 128 Connection.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnRecvRequest), Connection); 129 } catch { 170 } 171 RemoteConnection = new Socket(RemoteIP.AddressFamily, SocketType.Stream, ProtocolType.Tcp); 172 RemoteConnection.BeginConnect(new IPEndPoint(RemoteIP, RemotePort), new AsyncCallback(this.OnConnected), RemoteConnection); 176 byte[] LocalIP = Listener.GetLocalExternalIP().GetAddressBytes(); 177 AcceptSocket = new Socket(IPAddress.Any.AddressFamily, SocketType.Stream, ProtocolType.Tcp); 178 AcceptSocket.Bind(new IPEndPoint(IPAddress.Any, 0)); 178 AcceptSocket.Bind(new IPEndPoint(IPAddress.Any, 0)); 179 AcceptSocket.Listen(50); 180 Reply[0] = 5; //Version 5socketmodule.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 28 lines
3 4# We need the "socket" name for the function we export. 5import stdsocket 6 7# If we are to masquerade as the socket module, we need to provide the constants. 8for k, v in stdsocket.__dict__.iteritems(): 10 globals()[k] = v 11error = stdsocket.error 12timeout = stdsocket.timeout 18# use other methods. 19getaddrinfo = stdsocket.getaddrinfo 20 26 else: 27 return stdsocket.socket(*args) 28Socket.cpp git://github.com/LaurentGomila/SFML.git | C++ | 151 lines
37m_type (type), 38m_socket (priv::SocketImpl::invalidSocket()), 39m_isBlocking(true) 56 // Apply if the socket is already created 57 if (m_socket != priv::SocketImpl::invalidSocket()) 58 priv::SocketImpl::setBlocking(m_socket, blocking); 100 // Don't create the socket if it already exists 101 if (m_socket == priv::SocketImpl::invalidSocket()) 102 { 143 // Close the socket 144 if (m_socket != priv::SocketImpl::invalidSocket()) 145 { 146 priv::SocketImpl::close(m_socket); 147 m_socket = priv::SocketImpl::invalidSocket(); 148 }mud.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 193 lines
13 14# Monkeypatch in the 'stacklesssocket' module, so we get blocking sockets 15# which are Stackless compatible. This example code will avoid any use of 17import stacklesssocket 18#sys.modules["socket"] = stacklesssocket 19stacklesssocket.install() 100 def __init__(self, clientSocket, clientAddress): 101 self.clientSocket = clientSocket 102 self.clientAddress = clientAddress 157 def Run(self): 158 listenSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 159 listenSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 165 while 1: 166 clientSocket, clientAddress = listenSocket.accept() 167 Connection(clientSocket, clientAddress)teststdlibunittests.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 75 lines
29def run_unittests(): 30 from test import test_socket 31 from test import test_urllib 34 35 print "** run_unittests.test_socket" 36 test_socket.test_main() 66 if isinstance(e, ReferenceError): 67 print "run:EXCEPTION", str(e), asyncore.socket_map 68 else: 68 else: 69 print "run:EXCEPTION", asyncore.socket_map 70 traceback.print_exc()ultraesb.bat https://bitbucket.org/adroitlogic/ultraesb/ | Batch | 107 lines
20:xdebug 21set _XDEBUG="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" 22shiftUtils.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 364 lines
10using System.Net; 11using System.Net.Sockets; 12using System.Text; 300 { 301 public static IPAddress GetLocalIP(Socket activeSocket) 302 { 302 { 303 IPEndPoint ipEndPoint = activeSocket.LocalEndPoint as IPEndPoint; 304 305 if ( ipEndPoint == null || ipEndPoint.Address == IPAddress.Any ) 306 throw new Exception( "Socket not connected" ); 307tcp_server.h https://nil.svn.sourceforge.net/svnroot/nil | C Header | 78 lines
70 int net_max_wait_time; 71 //! Socket for the server to listen for client connections 72 int server_socket;SocketCamera.java git://github.com/billmccord/OpenCV-Android.git | Java | 94 lines
28/** 29 * This simple socket camera reads images from a socket connection. It is 30 * assumed that the server providing the socket is streaming video from an 48 * @param address the ip address of the camera server 49 * @param port the port that the camera server has opened a socket on 50 */ 65 66 Socket socket = null; 67 Bitmap bitmap = null; 69 Log.d(TAG, "Making socket connection"); 70 socket = new Socket(); 71 socket.bind(null); 72 socket.setSoTimeout(SOCKET_TIMEOUT); 73 socket.connect(new InetSocketAddress(mAddress, mPort), SOCKET_TIMEOUT); 74TcpListener.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 166 lines
59 /// 60 /// \return Port to which the socket is bound 61 /// 103 /// 104 /// \param socket Socket that will hold the new connection 105 /// 110 //////////////////////////////////////////////////////////// 111 Status accept(TcpSocket& socket); 112}; 124/// 125/// A listener socket is a special type of socket that listens to 126/// a given port and waits for connections on that port. 163/// 164/// \see sf::TcpSocket, sf::Socket 165///mochiweb_response.erl git://github.com/basho/mochiweb.git | Erlang | 90 lines
62%% @spec send(iodata(), response()) -> ok 63%% @doc Send data over the socket if the method is not HEAD. 64send(Data, {?MODULE, [Request, _Code, _Headers]}) ->xhr-polling.js git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | JavaScript | 63 lines
1/** 2 * Socket.IO client 3 *Client.js git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | JavaScript | 188 lines
31 32 if (!this.connection.sessionId) { // No sessionId variable means we're not using socket.io - just set that property to use our clientid 33 this.connection.sessionId = aClientid; 40 RealtimeMultiplayerGame.network.Client.prototype = { 41 connection: null, // SocketIO connection for this specific client 42 clientid: -1, // UUID for this client 165 /** 166 * Returns the sessionId as created by Socket.io for this client 167 * @return {String} A hash representing the session idAddress.java http://ambienttalk.googlecode.com/svn/ | Java | 203 lines
37import java.net.InetAddress; 38import java.net.ServerSocket; 39 47 * Implementation-wise, an <tt>Address</tt> encapsulates an IP address and a port number, 48 * which is the address on which the {@link ServerSocket} of the {@link MasterConnectionThread} 49 * is listening for incoming connections.TcpConnection.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 0 lines
8using System.Text; 9using System.Net.Sockets; 10using System.Net; 36 37 sock = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ); 38 38 39 var socketConnect = new SocketAsyncEventArgs(); 40 43 { 44 if ( e.SocketError == SocketError.Success ) 45 { 117 { 118 if ( e.SocketError == SocketError.Success ) 119 return;README.rst https://bitbucket.org/excieve/pyhs/ | ReStructuredText | 87 lines
8pyhs (python-handler-socket) is a Python client library for the 9`HandlerSocket <https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/>`_ 10MySQL plugin. 14 15First, install MySQL and HandlerSocket. Some of the client's functionality 16depends on latest revisions of the plugin so keep it up to date. 19 20 pip install python-handler-socket 21 23 24 pip install hg+http://bitbucket.org/excieve/pyhs#egg=python-handler-socket 25 42in ``docs`` directory inside the package or 43`online <http://python-handler-socket.readthedocs.org/>`_ on RTD. 44__init__.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 44 lines
4import threading 5import socket as stdsocket 6 33 import socket 34 sys.modules["stdsocket"] = __import__(socket.__name__) 35 del socket 36 37 # Obtain the asyncore-based socket module and put its 'socket' in place. 38 import stacklesssocket 38 import stacklesssocket 39 stackless.socket = stacklesssocket.socket 40 del stacklesssocket 42 import socketmodule 43 sys.modules["socket"] = socketmodule 44SocketJsonMain.java http://nutz.googlecode.com/svn/trunk/ | Java | 0 lines
8import org.nutz.lang.socket.SocketActionTable; 9import org.nutz.lang.socket.SocketAtom; 10import org.nutz.lang.socket.SocketLock; 10import org.nutz.lang.socket.SocketLock; 11import org.nutz.lang.socket.SocketMain; 12 14 15 public SocketJsonMain( List<SocketAtom> atoms, 16 SocketLock lock, 23 @Override 24 protected SocketAtom createSocketAtom( List<SocketAtom> atoms, 25 SocketLock lock, 27 SocketActionTable saTable) { 28 return new SocketJsonAtom(atoms, lock, socket, saTable); 29 }Socket.php git://github.com/pda/pheanstalk.git | PHP | 35 lines
3/** 4 * A mockable wrapper around PHP "socket" or "file pointer" access. 5 * Only the subset of socket actions required by Pheanstalk are provided. 10 */ 11interface Pheanstalk_Socket 12{ 13 /** 14 * Writes data to the socket. 15 * @param string $data 20 /** 21 * Reads up to $length bytes from the socket. 22 *Log.scala git://github.com/infinispan/infinispan.git | Scala | 100 lines
25import org.jboss.netty.channel.Channel 26import java.net.SocketAddress 27import org.infinispan.util.logging.LogFactory 86 87 def logChannelStillBound(ch: Channel, address: SocketAddress) = 88 log.channelStillBound(ch, address) 91 92 def logChannelStillConnected(ch: Channel, address: SocketAddress) = 93 log.channelStillConnected(ch, address)server_ssl http://ovz-web-panel.googlecode.com/svn/trunk/ | Ruby | 76 lines
51 52 Socket.do_not_reverse_lookup = true 53 server = WEBrick::HTTPServer.new(etch_udp_connection.h https://svn.apache.org/repos/asf/incubator/etch/ | C Header | 0 lines
74 75int is_good_udp_params(etch_url*, void* resources, etch_rawsocket*); 76etch_udp_connection* new_udp_connection(etch_url*, void* resources, etch_rawsocket*); 77int init_etch_udpconx_interfaces (etch_udp_connection*); 78int new_udpsocket (apr_socket_t**, apr_pool_t*); 79int destroy_etch_udp_connection(void* thisx);TCPSocket.yml git://github.com/appcelerator/titanium_desktop.git | YAML | 19 lines
1--- 2namespace: Titanium.Network.TCPSocket 3type: object 3type: object 4description: An object representing a TCP client socket connection. 5events: 6 - name: connect 7 description: The socket is now connected to the remote host. 8 - name: close 10 - name: data 11 description: "Data has arrived to the socket and is provided within a buffer. 12 Example: socket.on('data', function (data) { })" 15 - name: timeout 16 description: An operation on the socket has timed out. 17 - name: drainConfigServerClient.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 120 lines
31 32 uint externalIp = this.Socket.Reader.ReadUInt32(); 33 36 37 ushort keyLen = NetHelpers.EndianSwap( this.Socket.Reader.ReadUInt16() ); 38 byte[] key = this.Socket.Reader.ReadBytes( keyLen ); 39 40 ushort sigLen = NetHelpers.EndianSwap( this.Socket.Reader.ReadUInt16() ); 41 byte[] signature = this.Socket.Reader.ReadBytes( sigLen ); 59 60 uint externalIp = Socket.Reader.ReadUInt32(); 61 69 70 byte[] unk = Socket.Reader.ReadBytes( 11 ); 71NormalHttpServer.java git://github.com/tonyg/reversehttp.git | Java | 52 lines
3import java.io.IOException; 4import java.net.ServerSocket; 5import java.net.Socket; 8 private int port; 9 private ServerSocket serverSocket; 10 14 this.port = port; 15 this.serverSocket = new ServerSocket(port); 16 } 21 22 public ServerSocket getServerSocket() { 23 return serverSocket; 27 public void pollOnce() throws IOException { 28 Socket conn = serverSocket.accept(); 29 try {CMakeLists.txt git://github.com/LaurentGomila/SFML.git | CMake | 41 lines
4 add_subdirectory(ftp) 5 add_subdirectory(sockets) 6 endif()20090516133313_add_host_info_columns_to_host.rb http://vmaki.googlecode.com/svn/trunk/ | Ruby | 0 lines
9 add_column :hosts, :nodes, :integer 10 add_column :hosts, :sockets, :integer 11 add_column :hosts, :threads, :integer 22 remove_column :hosts, :nodes 23 remove_column :hosts, :sockets 24 remove_column :hosts, :threadsconfigure.ac http://futty.googlecode.com/svn/trunk/ | m4 | 108 lines
52 53AC_SEARCH_LIBS([socket], [xnet]) 54SocksClient.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 155 lines
32using System.Net; 33using System.Net.Sockets; 34using Org.Mentalis.Proxy; 43 ///<summary>Initializes a new instance of the SocksClient class.</summary> 44 ///<param name="ClientSocket">The Socket connection between this proxy server and the local client.</param> 45 ///<param name="Destroyer">The method to be called when this SocksClient object disconnects from the local client and the remote server.</param> 47 ///<remarks>If the AuthList is non-null, every client has to authenticate before he can use this proxy server to relay data. If it is null, the clients don't have to authenticate.</remarks> 48 public SocksClient(Socket ClientSocket, DestroyDelegate Destroyer, AuthenticationList AuthList) : base(ClientSocket, Destroyer) { 49 this.AuthList = AuthList; 75 try { 76 ClientSocket.BeginReceive(Buffer, 0, 1, SocketFlags.None, new AsyncCallback(this.OnStartSocksProtocol), ClientSocket); 77 } catch { 137 if (Handler != null) 138 return Handler.Username + " (" + ((IPEndPoint)ClientSocket.LocalEndPoint).Address.ToString() +") connected to " + DestinationSocket.RemoteEndPoint.ToString(); 139 elseGetHandler.java git://github.com/infinispan/infinispan.git | Java | 23 lines
1package org.infinispan.server.websocket.handlers; 2 3import org.infinispan.Cache; 4import org.infinispan.server.websocket.ChannelUtils; 5import org.infinispan.server.websocket.OpHandler; 5import org.infinispan.server.websocket.OpHandler; 6import org.infinispan.server.websocket.json.JsonObject; 7runEC2Demo-all.sh git://github.com/infinispan/infinispan.git | Shell | 38 lines
21 22# Sample JPDA settings for remote socket debugging 23#add_jvm_args "-Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"relay.ml git://github.com/jaked/lwt-equeue.git | OCaml | 57 lines
21 let buffer = String.create 8192 in 22 (* Read some data from the input socket *) 23 Lwt_unix.read in_ch buffer 0 8192 >>= (fun len -> 26 if len = 0 then return () else begin 27 (* Otherwise, we write the data to the ouput socket *) 28 let write = 38 39let new_socket () = Lwt_unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 40let local_addr num = Unix.ADDR_INET (Unix.inet_addr_any, num) 45 (* Initialize the listening address *) 46 let listening_socket = new_socket () in 47 Lwt_unix.setsockopt listening_socket Unix.SO_REUSEADDR true; 47 Lwt_unix.setsockopt listening_socket Unix.SO_REUSEADDR true; 48 Lwt_unix.bind listening_socket (local_addr listening_port); 49 Lwt_unix.listen listening_socket 1024;postgis-pg_hba.conf https://bitbucket.org/ianb/silverlining/ | Config | 88 lines
18# 19# The first field is the connection type: "local" is a Unix-domain socket, 20# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an 20# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an 21# SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket. 22# 76 77# Database administrative login by UNIX sockets 78local all postgres ident 81 82# "local" is for Unix domain socket connections only 83local all all identCMDTransmitATMessage.java http://ambienttalk.googlecode.com/svn/ | Java | 77 lines
74 // we do not need to send an explicit acknowledgement to the sender: if the transmission over 75 // its socket was successful, it knows that the message has at least arrived without failure. 76 }HTTPSServer.java http://apjp.googlecode.com/svn/trunk/ | Java | 266 lines
28 private Thread thread; 29 private SSLServerSocket sslServerSocket; 30 private List<HTTPSServerWorker> httpsServerWorkers; 142 { 143 sslServerSocket = HTTPS.createSSLServerSocket(remoteAddress, remotePort); 144 149 { 150 sslServerSocket.bind(new InetSocketAddress(APJP.APJP_LOCAL_HTTPS_SERVER_ADDRESS, APJP.APJP_LOCAL_HTTPS_SERVER_PORT + i)); 151 break; 184 { 185 SSLSocket outputSSLSocket = HTTPS.createSSLSocket(); 186 outputSSLSocket.connect(new InetSocketAddress(APJP.APJP_LOCAL_HTTPS_SERVER_ADDRESS, sslServerSocket.getLocalPort())); 242 { 243 SSLSocket inputSSLSocket = (SSLSocket) sslServerSocket.accept(); 244WebSocketController.java http://gwt-websocketrpc.googlecode.com/svn/gwt-websocketrpc/ | Java | 133 lines
5 6import org.gwt_websocketrpc.client.websocket.WebSocketImpl; 7import org.gwt_websocketrpc.client.websocket.WebSocket.ReadyState; 8import org.gwt_websocketrpc.client.websocket.WebSocket.StringOutbound; 9import org.gwt_websocketrpc.client.websocket.WebSocket.StringSocketHandler; 10import org.gwt_websocketrpc.shared.WsRpcConstants; 18public class WebSocketController { 19 private static final HashMap<String, WebSocketController> urlWsMap = new HashMap<String,WebSocketController>(); 20 20 21 public static WebSocketController createOrGetWebSocketController(String url){ 22 WebSocketController ws = urlWsMap.get(url); 44 45 private final StringSocketHandler socketHandler = new StringSocketHandler(){ 46RecaptchaValidator.cs http://recaptcha.googlecode.com/svn/trunk/ | C# | 169 lines
24using System.Net; 25using System.Net.Sockets; 26using System.Text;testing_test.py git://github.com/facebook/tornado.git | Python | 350 lines
90 server = HTTPServer(app, **self.get_httpserver_options()) 91 server.add_socket(sock) 92 self.second_port = portuconsole.sh https://bitbucket.org/adroitlogic/ultraesb/ | Shell | 138 lines
116if [ "$1" = "-xdebug" ]; then 117 XDEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000" 118 shifthttp-client-bad-url.c git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | C | 78 lines
51 52 SOCKET s = socket(PF_INET, SOCK_STREAM, 0); 53 assert(s != INVALID_SOCKET); 74 75 closesocket(s); 76 return 0;asyncoperations.lua git://github.com/JakobOvrum/LuaIRC.git | Lua | 89 lines
16 17 local bytes, err = self.socket:send(msg .. "\r\n") 18Util.java http://magic--another-game-engine.googlecode.com/svn/trunk/ | Java | 101 lines
6import java.net.DatagramPacket; 7import java.net.DatagramSocket; 8import java.net.InetAddress; 47 public static void broadcast (byte[] data, int port) throws IOException { 48 DatagramSocket socket = new DatagramSocket(); 49 broadcast(socket, data, port, NetworkInterface.getNetworkInterfaces()); 49 broadcast(socket, data, port, NetworkInterface.getNetworkInterfaces()); 50 socket.close(); 51 } 52 53 private static void broadcast (DatagramSocket socket, byte[] data, int port, Enumeration<NetworkInterface> ifaces) 54 throws IOException { 60 ip[3] = -1; // 255.255.255.0 61 socket.send(new DatagramPacket(data, data.length, InetAddress.getByAddress(ip), port)); 62 ip[2] = -1; // 255.255.0.0TcpSocket.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 154 lines
9using System.Net; 10using System.Net.Sockets; 11 14 /// <summary> 15 /// Represents a Tcp socket. 16 /// </summary> 16 /// </summary> 17 sealed class TcpSocket 18 { 18 { 19 Socket sock; 20 NetworkStream sockStream; 62 63 sock = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ); 64 var asyncResult = sock.BeginConnect( endPoint, null, null );Constants.java http://ametro.googlecode.com/svn/trunk/ | Java | 134 lines
38 public static final int HTTP_CONNECTION_TIMEOUT = 10000; 39 public static final int HTTP_SOCKET_TIMEOUT = 10000; 40xhr-polling.js git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | JavaScript | 133 lines
2/*! 3 * Socket.IO - transports - Polling 4 * Copyright (c) 2010-2011 Guillermo Rauch <guillermo@learnboost.com>Makefile.am git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | Makefile | 82 lines
56 $(resources) 57jscoverage_server_LDADD = js/obj/libjs.a -lm @EXTRA_SOCKET_LIBS@ @EXTRA_THREAD_LIBS@ @LIBICONV@ @EXTRA_TIMER_LIBS@ 58mochiweb_http.erl git://github.com/tonyg/reversehttp.git | Erlang | 132 lines
35stop() -> 36 mochiweb_socket_server:stop(?MODULE). 37 38stop(Name) -> 39 mochiweb_socket_server:stop(Name). 40 45start(Options) -> 46 mochiweb_socket_server:start(parse_options(Options)). 47 94 95loop(Socket, Body) -> 96 inet:setopts(Socket, [{packet, http}]), 96 inet:setopts(Socket, [{packet, http}]), 97 request(Socket, Body). 98sanitizer.py https://bitbucket.org/clarifiednetworks/vsroom/ | Python | 147 lines
1import socket 2socket.setdefaulttimeout(20) 74 try: 75 socket.inet_pton(socket.AF_INET, string) 76 except socket.error: 77 try: 78 socket.inet_pton(socket.AF_INET6, string) 79 except socket.error: 131 info = getPlaceInfo(event) 132 except (socket.error, httplib.HTTPException), e: 133 self.log.warning('Could not get location information ' +make_min_web2py.py https://code.google.com/p/web2py/ | Python | 98 lines
25IGNORED = """ 26gluon/contrib/websocket_messaging.py 27gluon/contrib/feedparser.pysetup.py https://bitbucket.org/excieve/pyhs/ | Python | 75 lines
40 setup( 41 name = 'python-handler-socket', 42 version = __import__('pyhs').__version__, 48 long_description = open('README.rst').read(), 49 description = 'HandlerSocket client for Python', 50 platforms = 'any',CMakeLists.txt git://github.com/LaurentGomila/SFML.git | CMake | 55 lines
15 ${INCROOT}/Packet.hpp 16 ${SRCROOT}/Socket.cpp 17 ${INCROOT}/Socket.hpp 17 ${INCROOT}/Socket.hpp 18 ${SRCROOT}/SocketImpl.hpp 19 ${INCROOT}/SocketHandle.hpp 19 ${INCROOT}/SocketHandle.hpp 20 ${SRCROOT}/SocketSelector.cpp 21 ${INCROOT}/SocketSelector.hpp 23 ${INCROOT}/TcpListener.hpp 24 ${SRCROOT}/TcpSocket.cpp 25 ${INCROOT}/TcpSocket.hpp 25 ${INCROOT}/TcpSocket.hpp 26 ${SRCROOT}/UdpSocket.cpp 27 ${INCROOT}/UdpSocket.hppWsRpcBuilder.java http://gwt-websocketrpc.googlecode.com/svn/gwt-websocketrpc/ | Java | 92 lines
1package org.gwt_websocketrpc.client; 2 2 3import org.gwt_websocketrpc.client.WebSocketController.RequestCallbackRegistration; 4 38 protected static class WsRequestBuilder extends RequestBuilder { 39 private final WebSocketController wsc; 40 int reqid; 46 this.isHandler = isHandler; 47 wsc = createWebSocketController(url); 48 } 49 50 protected WebSocketController createWebSocketController(String url) { 51 return WebSocketController.createOrGetWebSocketController(url);cowboy_acceptors_sup.erl git://github.com/extend/cowboy.git | Erlang | 0 lines
35 Protocol, ProtoOpts, ListenerPid, ReqsPid]) -> 36 {ok, LSocket} = Transport:listen(TransOpts), 37 MaxConns = proplists:get_value(max_connections, TransOpts, 1024), 38 Procs = [{{acceptor, self(), N}, {cowboy_acceptor, start_link, [ 39 LSocket, Transport, Protocol, ProtoOpts, 40 MaxConns, ListenerPid, ReqsPidSocketHandle.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 57 lines
24 25#ifndef SFML_SOCKETHANDLE_HPP 26#define SFML_SOCKETHANDLE_HPP 40//////////////////////////////////////////////////////////// 41// Define the low-level socket handle type, specific to 42// each platform 45 46 typedef UINT_PTR SocketHandle; 47 49 50 typedef int SocketHandle; 51 56 57#endif // SFML_SOCKETHANDLE_HPP 58index.rst https://bitbucket.org/excieve/pyhs/ | ReStructuredText | 35 lines
8 9pyhs is a pure Python client (with optional C speedups) for `HandlerSocket <https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL>`_ 10plugin to MySQL database. In short, it provides access to the data omitting 15See `this <http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html>`_ 16article for more details about HandlerSocket. 17configure.ac http://linux-track.googlecode.com/svn/trunk/ | m4 | 199 lines
35AC_CHECK_HEADERS([stdint.h assert.h]) 36AC_CHECK_HEADERS([stdlib.h unistd.h netdb.h sys/socket.h fcntl.h sys/ioctl.h]) 37 180AC_CHECK_FUNCS([select]) 181AC_CHECK_FUNCS([socket]) 182AC_CHECK_FUNCS([strerror])asmirc.asm git://github.com/duckinator/asmirc.git | Assembly | 65 lines
10 strStackSetupEnd: string 'Cleaning up stack...' 11 strSocketInit: string 'Initializing socket...' 12 strSocketConnect: string 'Connecting to ' 12 strSocketConnect: string 'Connecting to ' 13 strSocketClose: string 'Closing socket...' 14 strExit: string 'Exiting...' 22 nickname: string 'asmirc' 23 network: string "72.14.179.233" ; Convert this to something able to be placed in socketaddr_in.sin_addr 24 28_start: 29 ; Set up stack frame for file descriptor + socket + params for socket call 30 stackSetupStart 16 35 36 ; Initialize socket 37 print strSocketInitFitNesseServerTest.java git://github.com/unclebob/fitnesse.git | Java | 137 lines
12import fitnesse.responders.files.SampleFileUtility; 13import fitnesse.testutil.MockSocket; 14import fitnesse.testutil.FitNesseUtil; 59 public void testBadRequest() throws Exception { 60 String output = getSocketOutput("Bad Request \r\n\r\n", new WikiPageDummy()); 61 67 crawler.addPage(root, pageOnePath, "Page One Content"); 68 String output = getSocketOutput("GET /PageOne HTTP/1.1\r\n\r\n", root); 69 String expected = "Page One Content"; 104 SimpleResponse response = new SimpleResponse(200); 105 MockSocket socket = new MockSocket("something"); 106 122 private String getSocketOutput(String requestLine, WikiPage page) throws Exception { 123 MockSocket s = new MockSocket(requestLine); 124 context.rootPagePath = SampleFileUtility.base;Makefile git://github.com/ece291/ece291-pmodelib.git | Makefile | 80 lines
21 22OBJS = lib_load.o vbeaf.o textmode.o gfxfiles.o filefunc.o socket.o \ 23 dpmi_int.o dpmi_mem.o int_wrap.o rmcbwrap.o netbios.o misc.o \CookieStorage.htm git://github.com/ColdBox/coldbox-platform.git | HTML | 200 lines
41|- 42| secure || boolean || No || false || If browser does not support Secure Sockets Layer (SSL) security, the cookie is not sent. To use the cookie, the page must be accessed using the https protocol. 43|-Log.java git://github.com/infinispan/infinispan.git | Java | 44 lines
1package org.infinispan.server.websocket.logging; 2 2 3import org.infinispan.server.websocket.json.JsonConversionException; 4import org.jboss.logging.annotations.Cause; 8/** 9 * Log abstraction for the websocket server. For this module, message ids 10 * ranging from 13001 to 14000 inclusively have been reserved. 26 27 @Message(value = "Unexpected exception while closing Websockets script stream.", id = 13004) 28 IllegalStateException unableToCloseWebSocketsStream(@Cause Throwable t); 29 30 @Message(value = "Unexpected exception while sending Websockets script to client.", id = 13005) 31 IllegalStateException unableToSendWebSocketsScriptToTheClient(@Cause Throwable t);Communicator.java http://roomware.googlecode.com/svn/trunk/ | Java | 74 lines
18 protected boolean doLoop = true; 19 protected ServerSocket socket; 20 40 41 socket = new ServerSocket(webPort); 42 } 55 try { 56 Socket client = socket.accept(); 57 Thread t = new Thread(new WebService(roomwareServer, client, logger));ConnectionTest.php git://github.com/pda/pheanstalk.git | PHP | 98 lines
5use Pheanstalk\Command\StatsCommand; 6use Pheanstalk\Contract\SocketFactoryInterface; 7use Pheanstalk\Contract\SocketInterface; 8use Pheanstalk\Exception\ConnectionException; 9use Pheanstalk\Exception\SocketException; 10use PHPUnit\Framework\MockObject\MockObject; 24 return [ 25 'stream' => [new Connection(new SocketFactory($host, $port, 1, SocketFactory::STREAM))], 26 'fsockopen' => [new Connection(new SocketFactory($host, $port, 1, SocketFactory::FSOCKOPEN))], 26 'fsockopen' => [new Connection(new SocketFactory($host, $port, 1, SocketFactory::FSOCKOPEN))], 27 'socket' => [new Connection(new SocketFactory($host, $port, 1, SocketFactory::SOCKET))], 28 'autodetect' =>[new Connection(new SocketFactory($host, $port, 1, SocketFactory::AUTODETECT))] 79 { 80 $pheanstalk = new Pheanstalk(new Connection(new SocketFactory(SERVER_HOST, SERVER_PORT))); 81 $baseCount = $pheanstalk->stats()['current-connections'];configure.ac git://github.com/mozy/mordor.git | m4 | 111 lines
78# Checks for header files. 79AC_CHECK_HEADERS([fcntl.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h]) 80 98AC_FUNC_STRTOD 99AC_CHECK_FUNCS([clock_gettime ftruncate memchr memmove memset munmap rmdir socket strchr strstr strtoull]) 100TransportFactory.java git://github.com/infinispan/infinispan.git | Java | 92 lines
2 3import java.net.SocketAddress; 4import java.util.Collection; 27 28 Transport getTransport(Set<SocketAddress> failedServers, byte[] cacheName); 29 29 30 Transport getAddressTransport(SocketAddress server); 31 31 32 SocketAddress getSocketAddress(Object key, byte[] cacheName); 33 37 38 void updateServers(Collection<SocketAddress> newServers, byte[] cacheName, boolean quiet); 39Transport.java git://github.com/infinispan/infinispan.git | Java | 78 lines
2 3import java.net.SocketAddress; 4 63 * 64 * @return a <code>SocketAddress</code> reprensenting the remote endpoint 65 * of this transport, or <code>null</code> if it is not connected 67 */ 68 SocketAddress getRemoteSocketAddress(); 69QXmppReconnectionManager.cpp http://qxmpp.googlecode.com/svn/trunk/ | C++ | 0 lines
56 } 57 else if(m_client && error == QXmppClient::SocketError && !m_receivedConflict) 58 {SocketSelector.cpp git://github.com/LaurentGomila/SFML.git | C++ | 205 lines
60//////////////////////////////////////////////////////////// 61SocketSelector::SocketSelector(const SocketSelector& copy) : 62m_impl(new SocketSelectorImpl(*copy.m_impl)) 75//////////////////////////////////////////////////////////// 76void SocketSelector::add(Socket& socket) 77{ 117//////////////////////////////////////////////////////////// 118void SocketSelector::remove(Socket& socket) 119{ 174//////////////////////////////////////////////////////////// 175bool SocketSelector::isReady(Socket& socket) const 176{ 195//////////////////////////////////////////////////////////// 196SocketSelector& SocketSelector::operator =(const SocketSelector& right) 197{Server.cpp git://github.com/LaurentGomila/SFML.git | C++ | 200 lines
44 // Listen to the given port for incoming connections 45 if (m_listener.listen(port) != sf::Socket::Done) 46 return; 49 // Wait for a connection 50 if (m_listener.accept(m_client) != sf::Socket::Done) 51 return; 118 sf::Packet packet; 119 if (m_client.receive(packet) != sf::Socket::Done) 120 break; 157 sf::TcpListener m_listener; 158 sf::TcpSocket m_client; 159 sf::Mutex m_mutex;etch_resources.h https://svn.apache.org/repos/asf/incubator/etch/ | C Header | 0 lines
30 31const wchar_t* ETCH_RESXKEY_SOCKET; 32const wchar_t* ETCH_RESXKEY_ACCEPTED_CONX;WebSocketServer.java git://github.com/infinispan/infinispan.git | Java | 132 lines
16import org.infinispan.server.core.CacheIgnoreAware; 17import org.infinispan.server.websocket.configuration.WebSocketServerConfiguration; 18import org.infinispan.server.websocket.handlers.GetHandler; 36 * <p> 37 * Websocket specific code lifted from Netty WebSocket Server example. 38 * </p> 39 */ 40public class WebSocketServer extends AbstractProtocolServer<WebSocketServerConfiguration> { 41 47 48 public WebSocketServer() { 49 super("WebSocket"); 59 60 public void startInternal(WebSocketServerConfiguration configuration, EmbeddedCacheManager cacheManager) { 61 super.startInternal(configuration, cacheManager);TcpListener.cpp git://github.com/LaurentGomila/SFML.git | C++ | 131 lines
46{ 47 if (getHandle() != priv::SocketImpl::invalidSocket()) 48 { 87 { 88 // Oops, socket is deaf 89 err() << "Failed to listen to port " << port << std::endl; 105//////////////////////////////////////////////////////////// 106Socket::Status TcpListener::accept(TcpSocket& socket) 107{ 108 // Make sure that we're listening 109 if (getHandle() == priv::SocketImpl::invalidSocket()) 110 { 120 // Check for errors 121 if (remote == priv::SocketImpl::invalidSocket()) 122 return priv::SocketImpl::getErrorStatus();CMakeLists.txt https://bitbucket.org/oneb1t/crocoduckcore/ | CMake | 56 lines
36 ${CMAKE_SOURCE_DIR}/dep/include/g3dlite 37 ${CMAKE_SOURCE_DIR}/dep/include/sockets 38 ${CMAKE_SOURCE_DIR}/dep/recastnavigation/DetourEndToEndStress.scala git://github.com/twitter/finagle.git | Scala | 98 lines
10import com.twitter.util.{Future, Return, Throw, Stopwatch} 11import java.net.{SocketAddress, InetSocketAddress} 12import java.util.concurrent.CountDownLatch 55 .name("stressServer") 56 .bindTo(new InetSocketAddress(0)) 57 .codec(Http()) 61 62 private[this] def buildClient(concurrency: Int, addr: SocketAddress) = ClientBuilder() 63 .name("stressClient")EmuTCPConnection.h http://projecteqemu.googlecode.com/svn/trunk/ | C Header | 104 lines
34 35 EmuTCPConnection(uint32 ID, EmuTCPServer* iServer, SOCKET iSock, uint32 irIP, uint16 irPort, bool iOldFormat = false); 36 EmuTCPConnection(bool iOldFormat = false, EmuTCPServer* iRelayServer = 0, eTCPMode iMode = modePacket); // for outgoing connectionstest_conn.c https://svn.apache.org/repos/asf/incubator/etch/ | C | 0 lines
19static etch_tcpconn *accepted[MAX_TEST_CONNECTIONS]; 20static BOOLEAN got_accepted(apr_socket_t *socket_ptr); 21 67 68static BOOLEAN got_accepted(apr_socket_t *socket_ptr) 69{ 72 73 etch_tcpconn *accepted_ptr = etchconn_create_tcp_with_socket(socket_ptr); 74 if (accepted_ptr != NULL)SessionListener.java https://svn.apache.org/repos/asf/incubator/etch/ | Java | 0 lines
26 /** 27 * Delivers a socket to the session from the listener. 28 * @param connectionCassandraTestPool.scala git://github.com/shorrockin/cascal.git | Scala | 110 lines
6import java.net.ConnectException 7import org.apache.thrift.transport.{TTransportException, TSocket} 8import com.shorrockin.cascal.session._ 56 57 // try to make sockets until the server opens up - there has to be a better 58 // way - just not sure what it is. 58 // way - just not sure what it is. 59 val socket = new TSocket("localhost", 9160); 60 var opened = false 62 try { 63 socket.open() 64 opened = true 64 opened = true 65 socket.close() 66 } catch {SocketImpl.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 109 lines
32#include <sys/types.h> 33#include <sys/socket.h> 34#include <netinet/in.h> 46/// \brief Helper class implementing all the non-portable 47/// socket stuff; this is the Unix version 48/// 75 //////////////////////////////////////////////////////////// 76 static SocketHandle invalidSocket(); 77 78 //////////////////////////////////////////////////////////// 79 /// \brief Close and destroy a socket 80 /// 97 /// 98 /// \return Status corresponding to the last socket error 99 ///tcpcli.asm git://github.com/ece291/ece291-pmodelib.git | Assembly | 88 lines
38 39 ; Create a socket 40 invoke _Socket_create, dword SOCK_STREAM 42 js near .exit 43 mov [_socket], eax 44 71 ; Connect to the remote host 72 invoke _Socket_connect, dword [_socket], dword _address 73 test eax, eax 76 ; Send a little message (the server will print it out) 77 invoke _Socket_send, dword [_socket], dword _message, dword message_len, dword 0 78 test eax, eax 80.close: 81 invoke _Socket_close, dword [_socket] 82.exit:SBHeartbeatServerThread.java http://ambienttalk.googlecode.com/svn/ | Java | 102 lines
50 /** the socket over which to broadcast heartbeats */ 51 private DatagramSocket socket_; 52 62 63 public void startServing(DatagramSocket socket) { 64 socket_ = socket; 82 DatagramPacket packet = new DatagramPacket(identificationAddr_.serializedForm_, identificationAddr_.serializedForm_.length, sbAddress_.ipAddress_, sbAddress_.port_); 83 socket_.send(packet); 84 } catch (IOException ioe) { 88 } finally { 89 if (socket_ != null) { 90 socket_.close();simpleappserver.cpp git://github.com/mozy/mordor.git | C++ | 66 lines
10#include "mordor/main.h" 11#include "mordor/socket.h" 12#include "mordor/streams/memory.h" 12#include "mordor/streams/memory.h" 13#include "mordor/streams/socket.h" 14#include "mordor/streams/transfer.h" 48 IOManager ioManager; 49 Socket s(ioManager, AF_INET, SOCK_STREAM); 50 IPv4Address address(INADDR_ANY, 80); 55 while (true) { 56 Socket::ptr socket = s.accept(); 57 Stream::ptr stream(new SocketStream(socket));TCPServerSocket.h git://github.com/appcelerator/titanium_desktop.git | C Header | 69 lines
23#include <Poco/Net/SocketAcceptor.h> 24#include <Poco/Net/SocketNotification.h> 25#include <Poco/NObserver.h> 30 31class TCPServerSocketConnector { 32public: 32public: 33 TCPServerSocketConnector(KMethodRef callback,Poco::Net::ServerSocket& socket,Poco::Net::SocketReactor& reactor); 34 virtual ~TCPServerSocketConnector(); 39 KMethodRef callback; 40 Poco::Net::ServerSocket& socket; 41 Poco::Net::SocketReactor& reactor; 58 KMethodRef onCreate; 59 Poco::Net::ServerSocket* socket; 60 Poco::Net::SocketReactor reactor;tcp_socket.cpp https://nil.svn.sourceforge.net/svnroot/nil | C++ | 204 lines
1/*************************************************************************** 2 tcp_socket.cpp - TCP socket handling 3 -------------------------------------------------------------------------- 16 17#include "tcp_socket.h" 18#include "fluff.h" 83//------------------------------------------------------------------------- 84int Tcp_socket::send(void *buf, int len, unsigned int timeout) 85{ 85{ 86 int result = send_timeout(socket, buf, len, timeout); 87 88 if (result == -1) 89 logmsg(lt_error,"Time out while writing to the socket."); 90 else if (result == -2)test_web.erl git://github.com/apache/couchdb.git | Erlang | 100 lines
53get_port() -> 54 mochiweb_socket_server:get(?SERVER, port). 55DecafMUD.plugins.Encoding.iso88591.html https://bitbucket.org/stendec/decafmud/ | HTML | 304 lines
33<ul class="classList"> 34 <li class="namespace builtin"><a href="../symbols/_global_.html">_global_</a></li><li class="class"><a href="../symbols/DecafMUD.html">DecafMUD</a></li><li class="namespace"> <a href="../symbols/DecafMUD.plugins.html">.plugins</a></li><li class="nolink"> .Display</li><li class="class"> <a href="../symbols/DecafMUD.plugins.Display.standard.html">.standard</a></li><li class="nolink"> .Encoding</li><li class="namespace"> <a href="../symbols/DecafMUD.plugins.Encoding.cp437.html">.cp437</a></li><li class="namespace"> <a href="../symbols/DecafMUD.plugins.Encoding.iso88591.html">.iso88591</a></li><li class="namespace"> <a href="../symbols/DecafMUD.plugins.Encoding.iso885915.html">.iso885915</a></li><li class="namespace"> <a href="../symbols/DecafMUD.plugins.Encoding.utf8.html">.utf8</a></li><li class="nolink"> .Interface</li><li class="class"> <a href="../symbols/DecafMUD.plugins.Interface.simple.html">.simple</a></li><li class="nolink"> .Socket</li><li class="class"> <a href="../symbols/DecafMUD.plugins.Socket.websocket.html">.websocket</a></li><li class="nolink"> .Storage</li><li class="class"> <a href="../symbols/DecafMUD.plugins.Storage.standard.html">.standard</a></li><li class="nolink"> .Telopt</li><li class="class"> DecafMUD.plugins.Telopt.]</li><li class="class"> DecafMUD.plugins.Telopt.�</li><li class="namespace builtin"><a href="../symbols/String.html">String</a></li> 35</ul>TLS.hs git://github.com/snapframework/snap-server.git | Haskell | 165 lines
18import Data.Typeable (Typeable) 19import Network.Socket (Socket) 20#ifdef OPENSSL 23import Data.ByteString.Builder (byteString) 24import qualified Network.Socket as Socket 25import OpenSSL (withOpenSSL) 29import Snap.Internal.Http.Server.Address (getAddress) 30import Snap.Internal.Http.Server.Socket (acceptAndInitialize, bindSocket) 31import qualified System.IO.Streams as Streams 96 -> FilePath 97 -> IO (Socket, SSLContext) 98bindHttps bindAddress bindPort cert chainCert key = 124 acceptAndInitialize boundSocket restore $ \(sock, remoteAddr) -> do 125 localAddr <- Socket.getSocketName sock 126 (localPort, localHost) <- getAddress localAddrFitNesseServer.java git://github.com/unclebob/fitnesse.git | Java | 29 lines
5import java.io.IOException; 6import java.net.Socket; 7import java.util.concurrent.ExecutorService; 8 9import fitnesse.socketservice.SocketServer; 10 10 11public class FitNesseServer implements SocketServer { 12 private final FitNesseContext context; 20 @Override 21 public void serve(Socket s) throws IOException { 22 serve(s, 10000); 24 25 public void serve(Socket s, long requestTimeout) throws IOException { 26 FitNesseExpediter sender = new FitNesseExpediter(s, context, executorService, requestTimeout);cvcap_socket.cpp git://github.com/billmccord/OpenCV-Android.git | C++ | 302 lines
81 82 virtual ~CVCapture_Socket() 83 { 96 int width; // the width of the images received over the socket 97 int height; // the height of the images received over the socket 98 long readBufSize; // the length of the read buffer 207// Grabs a frame (image) from a socket. 208bool CVCapture_Socket::grabFrame() 209{ 216 217 // Establish the socket. 218 int sockd = socket(pAddrInfo->ai_family, pAddrInfo->ai_socktype, pAddrInfo->ai_protocol); 295{ 296 CVCapture_Socket* capture = new CVCapture_Socket; 297 if ( capture-> open(address, port, width, height) )VideoEmulationConfiguration.java git://github.com/billmccord/OpenCV-Android.git | Java | 130 lines
52 53 public static final String C_SOCKET_CAMERA = "C_SOCKET_CAMERA"; 54 54 55 public static final String JAVA_SOCKET_CAMERA = "JAVA_SOCKET_CAMERA"; 56 113 114 CheckBox useCSocketCamera = (CheckBox)findViewById(R.id.UseCSocketCapture); 115 if (useCSocketCamera.isChecked()) { 115 if (useCSocketCamera.isChecked()) { 116 invoker.putExtra(EXTRA_CAMERA_OPTION, C_SOCKET_CAMERA); 117 } else { 117 } else { 118 invoker.putExtra(EXTRA_CAMERA_OPTION, JAVA_SOCKET_CAMERA); 119 }AuthNone.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 49 lines
30 31using System.Net.Sockets; 32using Org.Mentalis.Proxy.Socks.Authentication; 42 ///<param name="Callback">The method to call when the authentication is complete.</param> 43 internal override void StartAuthentication(Socket Connection, AuthenticationCompleteDelegate Callback) { 44 Callback(true);QXmppIncomingClient.h http://qxmpp.googlecode.com/svn/trunk/ | C Header | 0 lines
43public: 44 QXmppIncomingClient(QSslSocket *socket, const QString &domain, QObject *parent = 0); 45 ~QXmppIncomingClient();SocketServer.java git://github.com/unclebob/fitnesse.git | Java | 29 lines
2// Released under the terms of the CPL Common Public License version 1.0. 3package fitnesse.socketservice; 4 10import java.io.PrintStream; 11import java.net.Socket; 12 12 13public interface SocketServer { 14 14 15 void serve(Socket s) throws IOException; 16 17 class StreamUtility { 18 public static PrintStream GetPrintStream(Socket s) throws IOException { 19 OutputStream os = s.getOutputStream();WorldSocketAcceptor.h git://github.com/SingularityCore/Singularity.git | C Header | 68 lines
20 * @{ 21 * \file WorldSocketMgr.h 22 */ 23 24#ifndef __WORLDSOCKETACCEPTOR_H_ 25#define __WORLDSOCKETACCEPTOR_H_ 31 32#include "WorldSocket.h" 33 33 34class WorldSocketAcceptor : public ACE_Acceptor<WorldSocket, ACE_SOCK_Acceptor> 35{ 36public: 37 WorldSocketAcceptor(void) { } 38 virtual ~WorldSocketAcceptor(void)tcpsrv.asm git://github.com/ece291/ece291-pmodelib.git | Assembly | 148 lines
17_socket resd 1 ; listening socket 18_connsocket resd 1 ; connection socket 19_gotaccept resb 1 53 invoke _LockArea, ds, dword _gotaccept, dword 1 54 invoke _LockArea, cs, dword _SocketHandler, dword _SocketHandler_end-_SocketHandler 55 invoke _Socket_SetCallback, dword _SocketHandler 92.getmore: 93 invoke _Socket_recv, dword [_connsocket], dword _buf, dword buf_len-1, dword 0 94 test eax, eax 112 ; close the connection socket 113 invoke _Socket_close, dword [_connsocket] 114 123.close: 124 invoke _Socket_close, dword [_socket] 125.exit:MSNPSharpException.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 85 lines
65 /// <param name="message">A textual presentation of the exception message</param> 66 /// <param name="innerException">The (inner)exception which caused this exception. For example a SocketException.</param> 67 public MSNPSharpException(string message, Exception innerException)tools.py http://navi-x.googlecode.com/svn/trunk/ | Python | 0 lines
3#Module specific Imports 4import socket 5import urllib2 50 51 socket.setdefaulttimeout(float(app.url_open_timeout)) 52socketlibevent.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 248 lines
6# Usage: 7# import sys, socketlibevent; sys.modules['socket'] = socketlibevent 8# 16from weakref import WeakValueDictionary 17import socket as stdsocket 18from socket import _fileobject 95def socket(family=AF_INET, type=SOCK_STREAM, proto=0): 96 return evsocket(stdsocket.socket(family, type, proto)) 97 145 s, a = self.sock.accept() 146 s.setsockopt(stdsocket.SOL_SOCKET, stdsocket.SO_REUSEADDR, 1) 147 s = evsocket(s) 224 s, a = self.sock.accept() 225 s.setsockopt(stdsocket.SOL_SOCKET, stdsocket.SO_REUSEADDR, 1) 226 s.setsockopt(stdsocket.IPPROTO_TCP, stdsocket.TCP_NODELAY, 1)CustomReader.java http://ambienttalk.googlecode.com/svn/ | Java | 50 lines
15 16 private final String URL = "socket://127.0.0.1:4444"; 17BugfixConnectionTest.php git://github.com/pda/pheanstalk.git | PHP | 77 lines
15 /** 16 * Issue: NativeSocket's read() doesn't work with jobs larger than 8192 bytes. 17 * 33 /** 34 * Issue: NativeSocket's read() cannot read all the bytes we want at once. 35 *MockSocket.java git://github.com/unclebob/fitnesse.git | Java | 89 lines
12import java.io.PipedOutputStream; 13import java.net.InetSocketAddress; 14import java.net.Socket; 14import java.net.Socket; 15import java.net.SocketAddress; 16 16 17public class MockSocket extends Socket { 18 InputStream input; 22 23 public MockSocket() { 24 try { 84 85 public SocketAddress getRemoteSocketAddress() { 86 return new InetSocketAddress(host, 123);chatdemo.py git://github.com/facebook/tornado.git | Python | 102 lines
15# under the License. 16"""Simplified chat demo for websockets. 17 25import tornado.web 26import tornado.websocket 27import os.path 36 def __init__(self): 37 handlers = [(r"/", MainHandler), (r"/chatsocket", ChatSocketHandler)] 38 settings = dict( 48 def get(self): 49 self.render("index.html", messages=ChatSocketHandler.cache) 50 51 52class ChatSocketHandler(tornado.websocket.WebSocketHandler): 53 waiters = set()SocketContext.java http://nutz.googlecode.com/svn/trunk/ | Java | 53 lines
1package org.nutz.lang.socket; 2 10 11public class SocketContext extends SimpleContext { 12 12 13 private SocketAtom atom; 14 14 15 public SocketContext(SocketAtom atom) { 16 this.atom = atom; 23 public String readLine() throws IOException { 24 if (atom.socket.isClosed()) 25 return null; 38 public void write(String str) { 39 if (!atom.socket.isClosed()) 40 try {haskell-style.md git://github.com/tibbe/haskell-style-guide.git | Markdown | 420 lines
254```haskell 255-- | Send a message on a socket. The socket must be in a connected 256-- state. Returns the number of bytes sent. Applications are 257-- responsible for ensuring that all data has been sent. 258send :: Socket -- ^ Connected socket 259 -> ByteString -- ^ Data to sendtransports.xhr-multipart.js git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | JavaScript | 217 lines
83 var _server = server() 84 , _socket = socket(_server) 85 , trips = 2; 123 var _server = server() 124 , _socket = socket(_server); 125 126 listen(_server, function(){ 127 var _client = get(_server, '/socket.io/xhr-multipart', function(response){ 128 var once = false 148 var _server = server() 149 , _socket = socket(_server, { transportOptions: { 150 'xhr-multipart': { 187 var _server = server() 188 , _socket = socket(_server, { 189 transportOptions: {testserver.py git://github.com/appcelerator/titanium_desktop.git | Python | 32 lines
1import threading 2import SocketServer 3 3 4class TestServerHandler(SocketServer.BaseRequestHandler): 5 """A simple testing server for TCP drillbit tests""" 25 26class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): 27 passNetwork.js git://github.com/appcelerator/titanium_desktop.git | JavaScript | 143 lines
14 value_of(Titanium.Network.createIRCClient).should_be_function(); 15 value_of(Titanium.Network.createTCPSocket).should_be_function(); 16 value_of(Titanium.Network.decodeURIComponent).should_be_function();QXmppIncomingServer.h http://qxmpp.googlecode.com/svn/trunk/ | C Header | 0 lines
41public: 42 QXmppIncomingServer(QSslSocket *socket, const QString &domain, QObject *parent); 43 ~QXmppIncomingServer();DSClient.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 91 lines
61 62 Socket.Disconnect(); 63 return null; 71 72 Socket.Disconnect(); 73 return null; 75 76 TcpPacket packet = Socket.ReceivePacket(); 77 return packet; 83 84 Socket.Disconnect(); 85 return null;network.h http://futty.googlecode.com/svn/trunk/ | C Header | 250 lines
24/* pay attention to levels of indirection */ 25typedef struct socket_function_table **Socket; 26typedef struct plug_function_table **Plug; 44 /* ignored by tcp, but vital for ssl */ 45 const char *(*socket_error) (Socket s); 46}; 173/* 174 * Set the `frozen' flag on a socket. A frozen socket is one in 175 * which all READABLE notifications are ignored, so that data is 223 224typedef struct ssl_client_socket_function_table **SSL_Client_Socket; 225typedef struct ssl_client_plug_function_table **SSL_Client_Plug; 243 244SSL_Client_Socket sk_ssl_client_over(Socket s, /* pre-existing (tcp) connection */ 245 SSL_Client_Plug p);net_fio.h https://bitbucket.org/ifcaro/open-ps2-loader/ | C++ Header | 36 lines
19int pko_lseek_file(int fd, unsigned int offset, int whence); 20void pko_close_socket(void); 21void pko_close_fsys(void);QXmppServer.h http://qxmpp.googlecode.com/svn/trunk/ | C Header | 0 lines
34class QSslKey; 35class QSslSocket; 36 108private slots: 109 void _q_clientConnection(QSslSocket *socket); 110 void _q_clientConnected(); 113 void _q_outgoingServerDisconnected(); 114 void _q_serverConnection(QSslSocket *socket); 115 void _q_serverDisconnected(); 140 /// This signal is emitted when a new connection is established. 141 void newConnection(QSslSocket *socket); 142 143private: 144 void incomingConnection(int socketDescriptor); 145 QXmppSslServerPrivate * const d;etch_tcp_connection.h https://svn.apache.org/repos/asf/incubator/etch/ | C Header | 0 lines
75 76etch_tcp_connection* new_tcp_connection(etch_url*, void* resources, etch_rawsocket*); 77int init_etch_tcpconx_interfaces (etch_tcp_connection*); 77int init_etch_tcpconx_interfaces (etch_tcp_connection*); 78int new_tcpsocket (apr_socket_t**, apr_pool_t*); 79int destroy_etch_tcp_connection(void* thisx); 90int etch_tcpclient_stop_listener (etch_tcp_connection*); 91int is_good_tcp_params(etch_url*, void* resources, etch_rawsocket*); 92HttpdCookies.h http://projecteqemu.googlecode.com/svn/trunk/ | C Header | 92 lines
9a separate license agreement is available. For information about 10the closed-source license agreement for the C++ sockets library, 11please visit http://www.alhem.net/Sockets/license.html and/or 34 35#ifdef SOCKETS_NAMESPACE 36namespace SOCKETS_NAMESPACE { 44//! Retrieve and manage cookies during a cgi call. 45class HTTPSocket; 46 47/** HTTP Cookie parse/container class. 48\sa HttpdSocket 49\sa HttpdForm 73 size_t getlength(const std::string& ); 74 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,const std::string& v); 75 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,long v);ProxyException.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 82 lines
32 33namespace Org.Mentalis.Network.ProxySocket { 34 /// <summary>runner.rb https://svn.apache.org/repos/asf/incubator/etch/ | Ruby | 0 lines
1require 'socket' 2require 'etch/bindings/ruby/transport/runner_handler.rb'StreamHandler.java https://svn.apache.org/repos/asf/incubator/etch/ | Java | 0 lines
21import java.nio.ByteBuffer; 22import java.nio.channels.SocketChannel; 23 26 */ 27public class StreamHandler extends AbstractHandler<SocketChannel> 28{ 34 */ 35 public StreamHandler( SocketChannel channel, boolean wantsConnect ) 36 throws IOException 103 { 104 channel().socket().shutdownOutput(); 105 }os_if.h git://github.com/TrinityCore/TrinityCore.git | C++ Header | 109 lines
6 * 7 * sockets local interfaces 8 *tcpweb.asm git://github.com/ece291/ece291-pmodelib.git | Assembly | 93 lines
34 35 ; Create a socket 36 invoke _Socket_create, dword SOCK_STREAM 56 ; Connect to the remote host 57 invoke _Socket_connect, dword [_socket], dword _address 58 test eax, eax 61 ; Send GET string 62 invoke _Socket_send, dword [_socket], dword _getstring, dword getstring_len, dword 0 63 test eax, eax 67.getmore: 68 invoke _Socket_recv, dword [_socket], dword _recvbuf, dword recvbuf_len-1, dword 0 69 test eax, eax 85.close: 86 invoke _Socket_close, dword [_socket] 87.exit:QXmppSocks.h http://qxmpp.googlecode.com/svn/trunk/ | C Header | 0 lines
27#include <QHostAddress> 28#include <QTcpSocket> 29 31 32class QXmppSocksClient : public QTcpSocket 33{ 69signals: 70 void newConnection(QTcpSocket *socket, QString hostName, quint16 port); 71 77 QTcpServer *m_server; 78 QMap<QTcpSocket*, int> m_states; 79};TLSConfig.as git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | ActionScript | 71 lines
3 * 4 * A set of configuration parameters for use by a TLSSocket or a TLSEngine. 5 * Most parameters are optional and will be set to appropriate default values for most use.UdpTransportFactory.java https://svn.apache.org/repos/asf/incubator/etch/ | Java | 0 lines
22 23import java.net.SocketAddress; 24 44 private final static String UDP_LISTENER = "UdpTransportFactory.udpListener"; 45 private final static String SOCKET_ADDRESS = "UdpTransportFactory.socketAddress"; 46 57 UdpListener udpListener = (UdpListener) resources.get( UDP_LISTENER ); 58 SocketAddress socketAddress = (SocketAddress) resources.get( SOCKET_ADDRESS ); 59 140 @Override 141 public void sessionAccepted( SocketAddress socketAddress ) throws Exception 142 { 146 r.put( UDP_LISTENER, listener ); 147 r.put( SOCKET_ADDRESS, socketAddress ); 148 r.put( Transport.VALUE_FACTORY, vf );basicWebserver.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 87 lines
3# handle concurrent requests each on their own tasklet (as opposed to 4# using the ThreadingMixIn from the SocketServer module). 5# 17 18# Monkeypatch in the stacklesssocket module. 19import sys, time 21import stacklesssocket 22#sys.modules["socket"] = stacklesssocket 23stacklesssocket.install() 67 request, client_address = self.get_request() 68 except socket.error: 69 returnApplicationEx.java http://ametro.googlecode.com/svn/trunk/ | Java | 326 lines
23import static org.ametro.app.Constants.HTTP_CONNECTION_TIMEOUT; 24import static org.ametro.app.Constants.HTTP_SOCKET_TIMEOUT; 25 42import org.apache.http.conn.ClientConnectionManager; 43import org.apache.http.conn.scheme.PlainSocketFactory; 44import org.apache.http.conn.scheme.Scheme; 45import org.apache.http.conn.scheme.SchemeRegistry; 46import org.apache.http.conn.ssl.SSLSocketFactory; 47import org.apache.http.impl.client.DefaultHttpClient; 293 HttpConnectionParams.setConnectionTimeout(params, HTTP_CONNECTION_TIMEOUT); 294 HttpConnectionParams.setSoTimeout(params, HTTP_SOCKET_TIMEOUT); 295 296 SchemeRegistry schReg = new SchemeRegistry(); 297 schReg.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); 298 schReg.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));decafmud.socket.flash.js https://bitbucket.org/stendec/decafmud/ | JavaScript | 238 lines
30 // Create an ID for this flash socket. 31 this.id = "DecafFlashSocket__" + ( ++ FlashSocket.last_id ); 32}; 41FlashSocket.prototype.connected = false; 42FlashSocket.prototype.socket = null; 43FlashSocket.prototype.ready = false; 140 if ( this.decaf.options.set_socket.policyport !== 843 && this.decaf.options.set_socket.policyport !== undefined ) { 141 this.socket.setPolicyPort(this.decaf.options.set_socket.policyport); } 142 186FlashSocket.executeCallback = function(id, type, data, data2) { 187 var sock = FlashSocket.sockets[id]; 188 231// Expose to DecafMUD 232DecafMUD.plugins.Socket.flash = FlashSocket; 233CMDTransmitATMessage.java http://ambienttalk.googlecode.com/svn/ | Java | 79 lines
71 // we do not need to send an explicit acknowledgement to the sender: if the transmission over 72 // its socket was successful, it knows that the message has at least arrived without failure. 73 // TODO: this may not be the case... JDK 1.5 documentation for flush() says:AIRAliases.js http://vmaki.googlecode.com/svn/trunk/ | JavaScript | 0 lines
105 air.URLVariables = window.runtime.flash.net.URLVariables; 106 air.Socket = window.runtime.flash.net.Socket; 107 air.XMLSocket = window.runtime.flash.net.XMLSocket; 201 air.__defineGetter__("ServiceMonitor", function() { return window.runtime.air.net.ServiceMonitor; }) 202 air.__defineGetter__("SocketMonitor", function() { return window.runtime.air.net.SocketMonitor; }) 203 air.__defineGetter__("URLMonitor", function() { return window.runtime.air.net.URLMonitor; })SocketDealer.java git://github.com/unclebob/fitnesse.git | Java | 34 lines
9public class SocketDealer { 10 private Map<Integer, SocketSeeker> waitingList = new HashMap<Integer, SocketSeeker>(17); 11 private int ticketCounter = 1; 12 13 public int seekingSocket(SocketSeeker seeker) { 14 int ticket = ticketCounter++; 18 19 public Collection<SocketSeeker> getWaitingList() { 20 return waitingList.values(); 22 23 public void dealSocketTo(int ticket, SocketDoner doner) throws Exception { 24 Integer key = new Integer(ticket); 24 Integer key = new Integer(ticket); 25 SocketSeeker seeker = waitingList.get(key); 26 seeker.acceptSocketFrom(doner);installation.rst https://bitbucket.org/excieve/pyhs/ | ReStructuredText | 56 lines
3 4HandlerSocket plugin 5-------------------- 8to do this, was getting the source code, compiling it and loading into the 9MySQL instance. Keep the HandlerSocket up to date as the client gets updated 10from time to time as new features or changes appear in the plugin. 13 14 `Installation guide <https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/blob/master/docs-en/installation.en.txt>`_ 15 HandlerSocket installation guide at the official repository. 26 27 pip install python-handler-socket 28 30 31 pip install hg+http://bitbucket.org/excieve/pyhs#egg=python-handler-socket 32HTTPServer.java http://ps3mediaserver.googlecode.com/svn/trunk/ | Java | 289 lines
45import org.jboss.netty.channel.group.DefaultChannelGroup; 46import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; 47import org.slf4j.Logger; 54 private String hostName; 55 private ServerSocketChannel serverSocketChannel; 56 private ServerSocket serverSocket; 117 if (!PMS.getConfiguration().isHTTPEngineV2()) { 118 serverSocketChannel = ServerSocketChannel.open(); 119 119 120 serverSocket = serverSocketChannel.socket(); 121 serverSocket.setReuseAddress(true); 240 try { 241 Socket socket = serverSocket.accept(); 242 InetAddress inetAddress = socket.getInetAddress();RtpStream.java git://github.com/CyanogenMod/android_frameworks_base.git | Java | 192 lines
21import java.net.Inet6Address; 22import java.net.SocketException; 23 66 * @param address The network address of the local host to bind to. 67 * @throws SocketException if the address cannot be bound or a problem 68 * occurs during binding. 69 */ 70 RtpStream(InetAddress address) throws SocketException { 71 mLocalPort = create(address.getHostAddress()); 74 75 private native int create(String address) throws SocketException; 76installd.h git://github.com/CyanogenMod/android_frameworks_base.git | C Header | 161 lines
30#include <utime.h> 31#include <sys/socket.h> 32#include <sys/types.h> 34 35#include <cutils/sockets.h> 36#include <cutils/log.h> 46 47#define SOCKET_PATH "installd" 48InterpreterServiceSpec.scala git://github.com/twitter/finagle.git | Scala | 48 lines
9import com.twitter.util.{Await, Time} 10import java.net.InetSocketAddress 11import org.specs.SpecificationWithJUnit 18 doBefore { 19 server = new InProcessMemcached(new InetSocketAddress(0)) 20 val address = server.start().localAddressTcpSocket.cpp git://github.com/LaurentGomila/SFML.git | C++ | 416 lines
53//////////////////////////////////////////////////////////// 54TcpSocket::TcpSocket() : 55Socket(Tcp) 101{ 102 if (getHandle() != priv::SocketImpl::invalidSocket()) 103 { 267//////////////////////////////////////////////////////////// 268Socket::Status TcpSocket::receive(void* data, std::size_t size, std::size_t& received) 269{ 300//////////////////////////////////////////////////////////// 301Socket::Status TcpSocket::send(Packet& packet) 302{ 345//////////////////////////////////////////////////////////// 346Socket::Status TcpSocket::receive(Packet& packet) 347{PortletPropsKeys.java git://github.com/liferay/liferay-plugins.git | Java | 48 lines
32 33 public static final String DRIVER_SOCKET_TIMEOUT = "driver.socketTimeout"; 34s-nt.h git://github.com/thelema/ocaml-community.git | C Header | 29 lines
19#define HAS_STRERROR 20#define HAS_SOCKETS 21#define HAS_GETCWDChunkedResponseTest.java git://github.com/unclebob/fitnesse.git | Java | 165 lines
12import java.io.UnsupportedEncodingException; 13import java.net.Socket; 14 39 @Override 40 public Socket getSocket() { 41 return null;OpenCVSample.java git://github.com/billmccord/OpenCV-Android.git | Java | 312 lines
55 56 public static final int DEFAULT_SOCKET_CAMERA_IMAGE_WIDTH = 320; 57 57 58 public static final int DEFAULT_SOCKET_CAMERA_IMAGE_HEIGHT = 240; 59 119 mRemoteCameraPort = extras.getInt(CameraConfiguration.EXTRA_REMOTE_CAMERA_PORT); 120 mCameraDevice = new SocketCamera(this, mSurfaceView, mRemoteCameraAddress, 121 mRemoteCameraPort, DEFAULT_SOCKET_CAMERA_IMAGE_WIDTH, 121 mRemoteCameraPort, DEFAULT_SOCKET_CAMERA_IMAGE_WIDTH, 122 DEFAULT_SOCKET_CAMERA_IMAGE_HEIGHT); 123 }ldap_stats.pm http://epicnms.googlecode.com/svn/trunk/ | Perl | 69 lines
43 44 my $ldap = new Net::LDAP($hash{'ip'}, port=> $hash{'port'}) or die "Failed to create socket to $hash{'ip'}:$hash{'port'}: Perl error: $@"; 45Makefile https://nil.svn.sourceforge.net/svnroot/nil | Makefile | 106 lines
83 tcp_server.o \ 84 tcp_socket.o \ 85 update_queue.o \Network_TCPSocket.js git://github.com/appcelerator/titanium_desktop.git | JavaScript | 123 lines
23 // Create a test socket client 24 this.socket = Titanium.Network.createTCPSocket("127.0.0.1", 8080); 25 }, 39 var timer; 40 var socket = this.socket; 41 48 49 socket.on("error", function(err) 50 { 64 var timer; 65 var socket = this.socket; 66 85 var message = "hello, can anyone hear me?"; 86 var socket = this.socket; 87NetworkServer.cpp http://uhasseltaacgua.googlecode.com/svn/trunk/ | C++ | 86 lines
10 11 // Create and initialize network sockets (UDP, UDP port, internal socket port) 12 bool result = ZCom_initSockets(true, mServerPort, mInternalPort); 14 if (!result) { 15 THROW(NetworkException, "Cannot initialize sockets"); 16 }dji.js git://github.com/square/cube.git | JavaScript | 41 lines
4 5// Connect to websocket. 6util.log("starting websocket client"); 36 stdin.on("end", function() { 37 util.log("stopping websocket client"); 38 client.close();EmuTCPServer.h http://projecteqemu.googlecode.com/svn/trunk/ | C Header | 39 lines
27 28 virtual void CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort); 29UDP.cpp git://github.com/LaurentGomila/SFML.git | C++ | 72 lines
15 // Create a socket to receive a message from anyone 16 sf::UdpSocket socket; 17 18 // Listen to messages on the specified port 19 if (socket.bind(port) != sf::Socket::Done) 20 return; 27 unsigned short senderPort; 28 if (socket.receive(in, sizeof(in), received, sender, senderPort) != sf::Socket::Done) 29 return; 33 const char out[] = "Hi, I'm the server"; 34 if (socket.send(out, sizeof(out), sender, senderPort) != sf::Socket::Done) 35 return; 55 // Create a socket for communicating with the server 56 sf::UdpSocket socket; 57CommunicationBus.java http://ambienttalk.googlecode.com/svn/ | Java | 75 lines
30 * Tries to connect the communication bus to the underlying network. 31 * @throws IOException if no server socket could be created to listen 32 * for incoming connections. If this exception is raised, it isudpsrv.asm git://github.com/ece291/ece291-pmodelib.git | Assembly | 127 lines
46 ; Bind socket to that address and port 47 invoke _Socket_bind, dword [_socket], dword _address 48 test eax, eax 52 invoke _LockArea, ds, dword _gotdatagram, dword 1 53 invoke _LockArea, cs, dword _SocketHandler, dword _SocketHandler_end-_SocketHandler 54 invoke _Socket_SetCallback, dword _SocketHandler 57 58 invoke _Socket_AddCallback, dword [_socket], dword SOCKEVENT_READ 59 test eax, eax 77 ; Get the datagram; we don't care about the source address 78 invoke _Socket_recvfrom, dword [_socket], dword _buf, dword buf_len-1, dword 0, dword 0 79 test eax, eax 102.close: 103 invoke _Socket_close, dword [_socket] 104.exit:CCUDPIn.java http://creativecomputing.googlecode.com/svn/trunk/ | Java | 149 lines
34 */ 35 private DatagramSocket _mySocket; 36 37 /** 38 * to this port the socket is listening 39 */ 58 _myPort = thePort; 59 _mySocket = new DatagramSocket(_myPort); 60 } catch (Exception e) { 64 65 public CCUDPIn(final DatagramSocket theSocket) { 66 _myPort = theSocket.getLocalPort(); 66 _myPort = theSocket.getLocalPort(); 67 _mySocket = theSocket; 68 }m_ssl.inc http://delphi-miranda-plugins.googlecode.com/svn/trunk/ | Pascal | 56 lines
27 HSSL = THANDLE; 28 TSOCKET = uint_ptr; // from Winsock.pas 29 32 cbSize:int; 33 connect : function(s:TSOCKET; const host:PAnsiChar; verify:int):HSSL; cdecl; 34 pending : function(ssl:HSSL):bool; cdecl;types.h http://projecteqemu.googlecode.com/svn/trunk/ | C Header | 0 lines
73 typedef void* ThreadReturnType; 74// typedef int SOCKET; 75 #define THREAD_RETURN(x) return(x);crisscross.h https://code.google.com/p/crisscross/ | C Header | 57 lines
36#include <crisscross/core_network.h> 37#include <crisscross/core_socket.h> 38#include <crisscross/tcpsocket.h> 38#include <crisscross/tcpsocket.h> 39#include <crisscross/udpsocket.h> 40#include <crisscross/cpuid.h>SocketMain.java http://nutz.googlecode.com/svn/trunk/ | Java | 0 lines
32 33 private List<SocketAtom> atoms; 34 34 35 public SocketMain( List<SocketAtom> atoms, 36 SocketLock lock, 48 // ç‰å¾…得到套接层 49 Socket socket; 50 try { 69 70 service.execute(createSocketAtom(atoms, lock, socket, saTable)); 71 87 88 protected SocketAtom createSocketAtom(List<SocketAtom> atoms, SocketLock lock, Socket socket, SocketActionTable saTable) { 89 return new SocketAtom(atoms, lock, socket, saTable);packetizer.rb https://svn.apache.org/repos/asf/incubator/etch/ | Ruby | 0 lines
1require 'socket' 2require 'etch/bindings/ruby/transport/who.rb'Action.php http://typecho.googlecode.com/svn/trunk/ | PHP | 158 lines
66 67 $client = Typecho_Http_Client::get('Curl', 'Socket'); 68 if (false == $client) {CMakeLists.txt https://bitbucket.org/oneb1t/crocoduckcore/ | CMake | 94 lines
63 oregonframework 64 oregonsockets 65 collisioninit.lua git://github.com/JakobOvrum/LuaIRC.git | Lua | 233 lines
1local socket = require "socket" 2 93 94 local s = socket.tcp() 95 118 119 self.socket = s 120 setmetatable(self, meta) 139 self:think() 140 socket.select(nil, nil, 0.1) -- Sleep so that we don't eat CPU 141 until self.authed 153function meta:shutdown() 154 self.socket:close() 155 setmetatable(self, nil) 158local function getline(self, errlevel) 159 local line, err = self.socket:receive("*l") 160haproxy.cfg git://github.com/sockjs/sockjs-node.git | Config | 43 lines
1# Requires recent Haproxy to work with websockets (for example 1.4.16). 2defaultsDB2Structure.h git://github.com/SingularityCore/Singularity.git | C Header | 136 lines
104 uint32 TotemCategory; // 115 105 uint32 Color[MAX_ITEM_PROTO_SOCKETS]; // 116 - 118 106 uint32 Content[MAX_ITEM_PROTO_SOCKETS]; // 119 - 121 106 uint32 Content[MAX_ITEM_PROTO_SOCKETS]; // 119 - 121 107 int32 SocketBonus; // 122 108 uint32 GemProperties; // 123twitterbot.py https://bitbucket.org/clarifiednetworks/vsroom/ | Python | 202 lines
34import re,time 35import socket 36from urllib2 import URLError 60 friends = api.GetFriends() 61 except (URLError,twitter.TwitterError,ValueError,JSONDecodeError,socket.error), e: 62 self.log.error("Twitter error: %s." % (e))next.rst git://github.com/facebook/tornado.git | ReStructuredText | 0 lines
22 and responses with no content. 23* `tornado.websocket` has been updated to support the latest protocol 24 (as finalized in RFC 6455).RealmAcceptor.h git://github.com/SingularityCore/Singularity.git | C Header | 47 lines
25 26#include "RealmSocket.h" 27#include "AuthSocket.h" 28 29class RealmAcceptor : public ACE_Acceptor<RealmSocket, ACE_SOCK_Acceptor> 30{ 35protected: 36 virtual int make_svc_handler(RealmSocket *&sh) 37 { 38 if (sh == 0) 39 ACE_NEW_RETURN(sh, RealmSocket, -1); 40 41 sh->reactor(reactor()); 42 sh->set_session(new AuthSocket(*sh)); 43 return 0;Program.cs https://hg01.codeplex.com/rxworkshop | C# | 40 lines
3using System.Net; 4using System.Net.Sockets; 5using System.Reactive;btmodule.h http://pybluez.googlecode.com/svn/trunk/ | C Header | 45 lines
13 14/* The object holding a socket. It holds some extra information, 15 like the address family, which is used to decode socket address 19 PyObject_HEAD 20 int sock_fd; /* Socket file descriptor */ 21 int sock_family; /* Address family, always AF_BLUETOOTH */ 21 int sock_family; /* Address family, always AF_BLUETOOTH */ 22 int sock_type; /* Socket type, e.g., SOCK_STREAM */ 23 int sock_proto; /* Protocol type, e.g., BTPROTO_L2CAP */ 29 30 int is_listening_socket; // XXX this is a hack to make 31 // sdp_advertise_service easier 32 33 uint32_t sdp_record_handle; // if it's a listening socket and advertised 34 // via SDP, this is the SDP handletest-readonly-attrs.js git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | JavaScript | 45 lines
1// Verify that some attributes of a WebSocket object are read-only. 2 4var sys = require('sys'); 5var WebSocket = require('../lib/websocket').WebSocket; 6var WebSocketServer = require('websocket-server/ws').Server; 9 10var wss = new WebSocketServer(); 11wss.listen(PORT, 'localhost'); 14}); 15var ws = new WebSocket('ws://localhost:' + PORT + '/', 'biff'); 16ws.addListener('open', function() {WorldSocket.h git://github.com/ProjectSkyfire/SkyFireEMU.git | C Header | 212 lines
21 * @{ 22 * \file WorldSocket.h 23 * \author Derex <derex101@gmail.com> 25 26#ifndef _WORLDSOCKET_H 27#define _WORLDSOCKET_H 48 49/// Handler that can communicate over stream sockets. 50typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> WorldHandler; 52/** 53 * WorldSocket. 54 * 64 * scale well to allocate memory for every. When something is 65 * written to the output buffer the socket is not immediately 66 * activated for output (again for the same reason), thereschema.rb http://vmaki.googlecode.com/svn/trunk/ | Ruby | 0 lines
29 t.integer "nodes" 30 t.integer "sockets" 31 t.integer "threads"PutHandler.java git://github.com/infinispan/infinispan.git | Java | 41 lines
1package org.infinispan.server.websocket.handlers; 2 5import org.infinispan.Cache; 6import org.infinispan.server.websocket.OpHandler; 7import org.infinispan.server.websocket.json.JsonObject; 7import org.infinispan.server.websocket.json.JsonObject; 8import org.infinispan.server.websocket.logging.Log; 9import org.infinispan.util.logging.LogFactory;WsRpcServiceGenerator.java http://gwt-websocketrpc.googlecode.com/svn/gwt-websocketrpc/ | Java | 54 lines
1package org.gwt_websocketrpc.rebind; 2 2 3import org.gwt_websocketrpc.client.ServerPushEnabled; 4import org.gwt_websocketrpc.client.WsRpcProxy;