PageRenderTime 238ms queryTime 25ms sortTime 2ms getByIdsTime 46ms findMatchingLines 50ms

100+ results results for 'socket repo:evilbinary/ecl' (238 ms)

Not the results you expected?
ServerClient.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 205 lines
                    
8using System.Net;
                    
9using System.Net.Sockets;
                    
10using System.Text;
                    
86        /// <value>The socket.</value>
                    
87        internal TcpSocket Socket { get; private set; }
                    
88        /// <summary>
                    
99        {
                    
100            get { return Socket.IsConnected; }
                    
101        }
                    
109            get { return Socket.ConnectionTimeout; }
                    
110            set { Socket.ConnectionTimeout = value; }
                    
111        }
                    
118        {
                    
119            Socket = new TcpSocket();
                    
120        }
                    
                
BridgeTest.as git://github.com/benbjohnson/melomel.git | ActionScript | 217 lines
                    
108		bridge.connect();
                    
109		socket = (bridge as MockBridge).getSocket() as MockXMLSocket;
                    
110		Async.proceedOnEvent(this, socket, "send");
                    
146		bridge.connect();
                    
147		socket = (bridge as MockBridge).getSocket() as MockXMLSocket;
                    
148		Async.proceedOnEvent(this, socket, "send");
                    
165		bridge.connect();
                    
166		socket = (bridge as MockBridge).getSocket() as MockXMLSocket;
                    
167		Async.proceedOnEvent(this, socket, "send");
                    
180		bridge.connect();
                    
181		socket = (bridge as MockBridge).getSocket() as MockXMLSocket;
                    
182		Async.proceedOnEvent(this, socket, "send");
                    
199		bridge.connect();
                    
200		socket = (bridge as MockBridge).getSocket() as MockXMLSocket;
                    
201		Async.proceedOnEvent(this, socket, "send");
                    
                
SocketConnection.hx git://github.com/outbounder/org.abn.haxe.git | Haxe | 408 lines
                    
50	public var port(default,null) : Int;
                    
51	public var socket(default,null) : Socket;
                    
52	public var secure(default,null) : Bool; //TODO move to jabber.socket.Connection
                    
80		
                    
81		socket = new Socket();
                    
82		
                    
90		#elseif (neko||cpp)
                    
91		socket = new Socket();
                    
92		buf = haxe.io.Bytes.alloc( defaultBufSize );
                    
147			#if flash9
                    
148			socket.addEventListener( ProgressEvent.SOCKET_DATA, sockDataHandler );
                    
149			#elseif (neko||php||cpp)
                    
159			#if flash9
                    
160			socket.removeEventListener( ProgressEvent.SOCKET_DATA, sockDataHandler );
                    
161			#elseif (neko||php||cpp)
                    
                
HttpClientService.java http://andrico.googlecode.com/svn/trunk/ | Java | 354 lines
                    
40import org.apache.http.conn.ClientConnectionManager;
                    
41import org.apache.http.conn.scheme.PlainSocketFactory;
                    
42import org.apache.http.conn.scheme.Scheme;
                    
43import org.apache.http.conn.scheme.SchemeRegistry;
                    
44import org.apache.http.conn.scheme.SocketFactory;
                    
45import org.apache.http.entity.mime.MultipartEntity;
                    
186        // by the default operator to look up socket factories.
                    
187        final SocketFactory sf = PlainSocketFactory.getSocketFactory();
                    
188        supportedSchemes.register(new Scheme("http", sf, 80));
                    
                
fake.php https://code.google.com/p/php-blackops-rcon/ | PHP | 546 lines
                    
30    /**
                    
31     * Socket res
                    
32     *
                    
34     */
                    
35    protected $socket = NULL;
                    
36
                    
103    {
                    
104        //fclose($this->socket);
                    
105    }
                    
118    /**
                    
119     * Get socket resource
                    
120     *
                    
122     */
                    
123    public function get_socket()
                    
124    {
                    
                
WsRpcServletWrapper.java http://gwt-websocketrpc.googlecode.com/svn/gwt-websocketrpc/ | Java | 271 lines
                    
1package org.gwt_websocketrpc.server;
                    
2
                    
4import static com.google.gwt.user.client.rpc.RpcRequestBuilder.STRONG_NAME_HEADER;
                    
5import static org.gwt_websocketrpc.shared.WsRpcConstants.WsRpcControlString;
                    
6import static org.gwt_websocketrpc.server.ServerUtils.d;
                    
17
                    
18import org.eclipse.jetty.websocket.WebSocket;
                    
19import org.gwt_websocketrpc.server.websocket.WsOutboundStream;
                    
30@SuppressWarnings("serial")
                    
31class WsRpcServletWrapper extends RpcServlet implements WebSocket {
                    
32
                    
139
                    
140        // Instead we'll just grab it from the WebSocket message.
                    
141        final String permStrongName = arg1.substring(0, snId);
                    
217      // Set the TCCL...
                    
218      // Possibly a bug in Jetty, WebSocketServlet's appear
                    
219      // to have the incorrect TCCL set. The Java App
                    
                
CCLog.java http://creativecomputing.googlecode.com/svn/trunk/ | Java | 327 lines
                    
15import java.util.logging.SimpleFormatter;
                    
16import java.util.logging.SocketHandler;
                    
17import java.util.logging.XMLFormatter;
                    
60	private static FileHandler ourFileHandler = null;
                    
61	private static SocketHandler ourTCPHandler = null;
                    
62	private static boolean ourInitialized = false;
                    
186			try {
                    
187				ourTCPHandler = new SocketHandler(TCP_HOST, Integer.parseInt(TCP_PORT));
                    
188				ourTCPHandler.setLevel(TCP_VERBOSITY);
                    
189				ourTCPHandler.setFormatter(createFormatter(TCP_FORMAT));
                    
190				CCLog.info("logging to socket: " + TCP_HOST + ":" + TCP_PORT);
                    
191			} catch (IllegalArgumentException e) {
                    
                
SocketStream.cc https://freespeech.svn.sourceforge.net/svnroot/freespeech | C++ | 558 lines
                    
280  if((m_listen_socket = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
                    
281    perror("network_socket::init_tcp_stream : call to socket() failed; socket not created.");
                    
282    throw new GeneralException("network_socket::init_tcp_stream : socket not created.",__FILE__,__LINE__);
                    
324	
                    
325	throw new GeneralException("network_socket::init_tcp_stream : could not set flags (O_NONBLOCK) of the socket."
                    
326				 ,__FILE__,__LINE__);   
                    
333 
                    
334  if(setsockopt(m_listen_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&one, sizeof(one))) {
                    
335    
                    
356
                    
357    perror ("network_socket::init_tcp_stream : bind() failed; socket not created.");
                    
358    shutdown();
                    
446  if((m_write_socket = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
                    
447    perror("network_socket::connect(): socket() failed");
                    
448    throw new GeneralException("network_socket::connect connect() failed",__FILE__,__LINE__);
                    
                
mysqli_driver.php git://github.com/EllisLab/CodeIgniter.git | PHP | 540 lines
                    
118	{
                    
119		// Do we have a socket path?
                    
120		if ($this->hostname[0] === '/')
                    
123			$port = NULL;
                    
124			$socket = $this->hostname;
                    
125		}
                    
130			$port = empty($this->port) ? NULL : $this->port;
                    
131			$socket = NULL;
                    
132		}
                    
202
                    
203		if ($this->_mysqli->real_connect($hostname, $this->username, $this->password, $this->database, $port, $socket, $client_flags))
                    
204		{
                    
                
SocksHandler.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 242 lines
                    
107			try {
                    
108				m_RemoteConnection.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1);
                    
109			} catch {}
                    
113	///<value>A Socket that is used to accept incoming connections.</value>
                    
114	protected Socket AcceptSocket {
                    
115		get {
                    
118		set {
                    
119			m_AcceptSocket = value;
                    
120		}
                    
203			else
                    
204				AcceptSocket.BeginAccept(new AsyncCallback(this.OnAccept), AcceptSocket);
                    
205		} catch {
                    
233	/// <summary>Holds the value of the AcceptSocket property.</summary>
                    
234	private Socket m_AcceptSocket;
                    
235	/// <summary>Holds the value of the RemoteBindIP property.</summary>
                    
                
raw_socket_service.hpp http://hadesmem.googlecode.com/svn/trunk/ | C++ Header | 0 lines
                    
1//
                    
2// raw_socket_service.hpp
                    
3// ~~~~~~~~~~~~~~~~~~~~~~
                    
10
                    
11#ifndef BOOST_ASIO_RAW_SOCKET_SERVICE_HPP
                    
12#define BOOST_ASIO_RAW_SOCKET_SERVICE_HPP
                    
23#if defined(BOOST_ASIO_HAS_IOCP)
                    
24# include <boost/asio/detail/win_iocp_socket_service.hpp>
                    
25#else
                    
25#else
                    
26# include <boost/asio/detail/reactive_socket_service.hpp>
                    
27#endif
                    
132
                    
133  /// Assign an existing native socket to a raw socket.
                    
134  boost::system::error_code assign(implementation_type& impl,
                    
                
Connection.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 0 lines
                    
8using System.Text;
                    
9using System.Net.Sockets;
                    
10using System.Net;
                    
                
InventoryPacket.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 437 lines
                    
245            writeFusionStones(buf, item);
                    
246            writeC(buf, item.hasOptionalFusionSocket() ? item.getOptionalFusionSocket() : 0x00);
                    
247        }
                    
261        writeD(buf, item.getItemSkinTemplate().getTemplateId());
                    
262        writeC(buf, item.hasOptionalSocket() ? item.getOptionalSocket() : 0x00);
                    
263
                    
396        writeD(buf, item.getItemSkinTemplate().getTemplateId());
                    
397        writeC(buf, item.hasOptionalSocket() ? item.getOptionalSocket() : 0x00);
                    
398
                    
                
ChatServerConnection.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 178 lines
                    
26import java.nio.ByteBuffer;
                    
27import java.nio.channels.SocketChannel;
                    
28import java.util.ArrayDeque;
                    
68
                    
69    public ChatServerConnection(SocketChannel sc, Dispatcher d, CsPacketHandler csPacketHandler) throws IOException {
                    
70        super(sc, d);
                    
                
SocketImpl.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 112 lines
                    
52////////////////////////////////////////////////////////////
                    
53class SocketImpl
                    
54{
                    
78    ////////////////////////////////////////////////////////////
                    
79    static SocketHandle invalidSocket();
                    
80
                    
81    ////////////////////////////////////////////////////////////
                    
82    /// \brief Close and destroy a socket
                    
83    ///
                    
83    ///
                    
84    /// \param sock Handle of the socket to close
                    
85    ///
                    
111
                    
112#endif // SFML_SOCKETIMPL_HPP
                    
113
                    
                
RemoteX11AcceptThread.java https://code.google.com/p/sshtunnel/ | Java | 245 lines
                    
5import java.io.OutputStream;
                    
6import java.net.Socket;
                    
7
                    
25
                    
26	Socket s;
                    
27
                    
172
                    
173			s = new Socket(sd.hostname, sd.port);
                    
174
                    
                
PCCardAdapterPlugin.h git://github.com/openframeworks/openFrameworks.git | C Header | 205 lines
                    
109CSReportStatusChange            (const RegEntryID *     adapterRef,
                    
110                                 PCCardSocket           whichSocket,
                    
111                                 PCCardSCEvents         statusChange,
                    
125typedef CALLBACK_API_C( OSStatus , SSInquireSocketProc )(PCCardSocket socket, ItemCount *numberOfWindows, PCCardSocketStatus *supportedSocketStatus, PCCardSCEvents *supportedStatusChange);
                    
126typedef CALLBACK_API_C( OSStatus , SSGetSocketProc )(PCCardSocket socket, PCCardVoltage *Vcc, PCCardVoltage *Vpp, PCCardVoltage *Vs, PCCardInterfaceType *socketIF, PCCardCustomInterfaceID *customIFID, PCCardSocketStatus *socketStatus, PCCardSCEvents *SCEventsMask, PCCardIRQ *IRQ, PCCardDMA *DMA);
                    
127typedef CALLBACK_API_C( OSStatus , SSSetSocketProc )(PCCardSocket socket, PCCardVoltage Vcc, PCCardVoltage Vpp, PCCardInterfaceType socketIF, PCCardCustomInterfaceID customIFID, PCCardSocketStatus statusReset, PCCardSCEvents SCEventsMask, PCCardIRQ IRQ, PCCardDMA DMA);
                    
128typedef CALLBACK_API_C( OSStatus , SSResetSocketProc )(PCCardSocket socket);
                    
129typedef CALLBACK_API_C( OSStatus , SSGetStatusProc )(PCCardSocket socket, PCCardSocketStatus *currentStatus, PCCardSocketStatus *changedStatus);
                    
130typedef CALLBACK_API_C( OSStatus , SSInquireWindowProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PCCardWindowSize *windowSize, PCCardWindowAlign *windowAlign);
                    
135typedef CALLBACK_API_C( OSStatus , SSInquireBridgeWindowProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PCCardWindowSize *windowSize, PCCardWindowAlign *windowAlign);
                    
136typedef CALLBACK_API_C( OSStatus , SSGetBridgeWindowProc )(PCCardSocket *socket, PCCardWindow window, PCCardWindowState *windowState, PhysicalAddress *startAddress, PCCardWindowSize *windowSize);
                    
137typedef CALLBACK_API_C( OSStatus , SSSetBridgeWindowProc )(PCCardSocket socket, PCCardWindow window, PCCardWindowState windowState, PhysicalAddress startAddress, PCCardWindowSize windowSize);
                    
168    SSSetSocketProc                 setSocket;
                    
169    SSResetSocketProc               resetSocket;
                    
170    SSGetStatusProc                 getStatus;
                    
                
views.py git://github.com/flashingpumpkin/django-socialregistration.git | Python | 348 lines
                    
11import logging
                    
12import socket
                    
13
                    
215            return self.error_to_response(request, {'error': error})
                    
216        except socket.timeout:
                    
217            return self.error_to_response(request, {'error': 
                    
262            return self.error_to_response(request, {'error': error})
                    
263        except socket.timeout:
                    
264            return self.error_to_response(request, {'error':
                    
                
config.lua http://ibus-sogoupycc.googlecode.com/svn/trunk/ | Lua | 84 lines
                    
4-- ?? luasocket ??
                    
5http, url = require('socket.http'), require('socket.url')
                    
6
                    
                
SOCK_SEQPACK_Association.h https://bitbucket.org/oregon/oregoncore/ | C Header | 200 lines
                    
46 * then the call behaves as a normal send/recv call, i.e., for
                    
47 * blocking sockets, the call will block until action is possible;
                    
48 * for non-blocking sockets, EWOULDBLOCK will be returned if no
                    
52 * The "_n()" I/O methods keep looping until all the data has been
                    
53 * transferred.  These methods also work for sockets in non-blocking
                    
54 * mode i.e., they keep looping on EWOULDBLOCK.  @a timeout is used
                    
107
                    
108  /// Try to recv exactly @a len bytes into @a buf from the connected socket.
                    
109  ssize_t recv_n (void *buf,
                    
114
                    
115  /// Try to recv exactly @a len bytes into @a buf from the connected socket.
                    
116  ssize_t recv_n (void *buf,
                    
120
                    
121  /// Receive an <iovec> of size <iovcnt> from the connected socket.
                    
122  ssize_t recvv_n (iovec iov[],
                    
                
Program.vb https://hg01.codeplex.com/sharpsnmplib | Visual Basic | 217 lines
                    
13Imports System.Net
                    
14Imports System.Net.Sockets
                    
15
                    
192            Console.WriteLine(ex)
                    
193        Catch ex As SocketException
                    
194            Console.WriteLine(ex)
                    
                
ZkTestServer.java git://github.com/apache/lucene-solr.git | Java | 346 lines
                    
25import java.net.InetAddress;
                    
26import java.net.InetSocketAddress;
                    
27import java.net.Socket;
                    
201              try {
                    
202                this.clientPortAddress = new InetSocketAddress(
                    
203                        InetAddress.getByName(clientPortAddress.getHostName()), clientPort);
                    
207            } else {
                    
208              this.clientPortAddress = new InetSocketAddress(clientPort);
                    
209            }
                    
295
                    
296      Socket sock = new Socket(host, port);
                    
297      BufferedReader reader = null;
                    
                
dns-unit.rkt git://github.com/gmarceau/PLT.git | Racket | 339 lines
                    
158                            type class)]
                    
159         [udp (udp-open-socket)]
                    
160         [reply
                    
                
project.properties https://bitbucket.org/jlahoda/jackpot30/ | Properties File | 137 lines
                    
18# Uncomment to specify the preferred debugger connection transport:
                    
19#debug.transport=dt_socket
                    
20debug.classpath=\
                    
                
SocketHandler.h https://bitbucket.org/oregon/oregoncore/ | C Header | 0 lines
                    
56    /** Map type for holding file descriptors/socket object pointers. */
                    
57    typedef std::map<SOCKET,Socket *> socket_m;
                    
58
                    
114    /** Find available open connection (used by connection pool). */
                    
115    ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&);
                    
116    /** Enable connection pool (by default disabled). */
                    
202protected:
                    
203    socket_m m_sockets; ///< Active sockets map
                    
204    socket_m m_add; ///< Sockets to be added to sockets map
                    
213    void CheckList(socket_v&,const std::string&); ///< Used by CheckSanity
                    
214    /** Remove socket from socket map, used by Socket class. */
                    
215    void Remove(Socket *);
                    
215    void Remove(Socket *);
                    
216    SOCKET m_maxsock; ///< Highest file descriptor + 1 in active sockets list
                    
217    fd_set m_rfds; ///< file descriptor set monitored for read events
                    
                
ISocketHandler.h https://bitbucket.org/oregon/oregoncore/ | C Header | 0 lines
                    
67#ifdef ENABLE_POOL
                    
68    class PoolSocket : public Socket
                    
69    {
                    
70    public:
                    
71        PoolSocket(ISocketHandler& h,Socket *src) : Socket(h) {
                    
72            CopyConnection( src );
                    
103private:
                    
104    /** Remove socket from socket map, used by Socket class. */
                    
105    virtual void Remove(Socket *) = 0;
                    
135    /** Find available open connection (used by connection pool). */
                    
136    virtual ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&) = 0;
                    
137    /** Enable connection pool (by default disabled). */
                    
230
                    
231#endif // _SOCKETS_ISocketHandler_H
                    
232
                    
                
AuthUserPass.cs http://msnp-sharp.googlecode.com/svn/trunk/ | C# | 144 lines
                    
33using System.Net;
                    
34using System.Net.Sockets;
                    
35using Org.Mentalis.Proxy;
                    
51	///<param name="Callback">The method to call when the authentication is complete.</param>
                    
52	internal override void StartAuthentication(Socket Connection, AuthenticationCompleteDelegate Callback) {
                    
53		this.Connection = Connection;
                    
56			Bytes = null;
                    
57			Connection.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnRecvRequest), Connection);
                    
58		} catch {
                    
74			else
                    
75				Connection.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, new AsyncCallback(this.OnRecvRequest), Connection);
                    
76		} catch {
                    
98				ToSend = new byte[]{5, 0};
                    
99				Connection.BeginSend(ToSend, 0, ToSend.Length, SocketFlags.None, new AsyncCallback(this.OnOkSent), Connection);
                    
100			} else {
                    
                
GsConnection.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 235 lines
                    
27import java.nio.ByteBuffer;
                    
28import java.nio.channels.SocketChannel;
                    
29import java.util.ArrayDeque;
                    
78     */
                    
79    public GsConnection(SocketChannel sc, Dispatcher d) throws IOException {
                    
80        super(sc, d);
                    
                
Dispatcher.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 344 lines
                    
28import java.nio.channels.Selector;
                    
29import java.nio.channels.SocketChannel;
                    
30import java.nio.channels.spi.SelectorProvider;
                    
162    /**
                    
163     * Read data from socketChannel represented by SelectionKey key. Parse and Process data. Prepare buffer for next
                    
164     * read.
                    
168    final void read(SelectionKey key) {
                    
169        SocketChannel socketChannel = (SocketChannel) key.channel();
                    
170        AConnection con = (AConnection) key.attachment();
                    
183        try {
                    
184            numRead = socketChannel.read(rb);
                    
185        }
                    
255    final void write(SelectionKey key) {
                    
256        SocketChannel socketChannel = (SocketChannel) key.channel();
                    
257        AConnection con = (AConnection) key.attachment();
                    
                
WindowChannel.java http://speedtracer.googlecode.com/svn/trunk/ | Java | 334 lines
                    
144
                    
145    private void setSocket(Socket socket) {
                    
146      assert !connected;
                    
195
                    
196    private Request(Socket socket, SetSocketCallback callback) {
                    
197      this.socket = socket;
                    
242    @SuppressWarnings("unused")
                    
243    private void handleConnect(Socket socket, SetSocketCallback callback) {
                    
244      listener.onClientChannelRequested(new Request(socket, callback));
                    
271
                    
272    public native void connect(Socket socket, SetSocketCallback callback) /*-{
                    
273      return this(socket, callback);
                    
292
                    
293    public native void setSocket(Socket socket) /*-{
                    
294      this(socket);
                    
                
ActorWorkbench.cpp https://jetpp.svn.sourceforge.net/svnroot/jetpp | C++ | 147 lines
                    
51
                    
52	if (!AfxSocketInit())
                    
53	{
                    
53	{
                    
54		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
                    
55		return FALSE;
                    
                
mysql_recv.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 0 lines
                    
37-record(state, {
                    
38	  socket,
                    
39	  parent,
                    
59%%           Parent and waits for the next frame.
                    
60%% Returns : {ok, RecvPid, Socket} |
                    
61%%           {error, Reason}
                    
62%%           RecvPid = pid(), receiver process pid
                    
63%%           Socket  = term(), gen_tcp socket
                    
64%%           Reason  = atom() | string()
                    
70		   end),
                    
71    %% wait for the socket from the spawned pid
                    
72    receive
                    
75	{mysql_recv, RecvPid, init, {ok, Socket}} ->
                    
76	    {ok, RecvPid, Socket}
                    
77    after ?CONNECT_TIMEOUT ->
                    
                
QXmppSocks.cpp http://qxmpp.googlecode.com/svn/trunk/ | C++ | 0 lines
                    
247{
                    
248    QTcpSocket *socket = m_server->nextPendingConnection();
                    
249    if (!socket)
                    
251
                    
252    // register socket
                    
253    m_states.insert(socket, ConnectState);
                    
258{
                    
259    QTcpSocket *socket = qobject_cast<QTcpSocket*>(sender());
                    
260    if (!socket || !m_states.contains(socket))
                    
267        // receive connect to server request
                    
268        QByteArray buffer = socket->readAll();
                    
269        if (buffer.size() < 3 ||
                    
290            qWarning("QXmppSocksServer received bad authentication method");
                    
291            socket->close();
                    
292            return;
                    
                
serve_socket.cpp http://qipmsg.googlecode.com/svn/trunk/ | C++ | 409 lines
                    
49
                    
50ServeSocket::ServeSocket(int socketDescriptor, QObject *parent)
                    
51    : QObject(parent)
                    
56            this, SLOT(updateBytesWrited(qint64)));
                    
57    connect(&m_tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
                    
58            this, SLOT(socketError(QAbstractSocket::SocketError)));
                    
60}
                    
61ServeSocket::~ServeSocket()
                    
62{
                    
94//
                    
95//        recvBlock.append(m_tcpSocket.read(m_tcpSocket.bytesAvailable()));
                    
96//
                    
124
                    
125bool ServeSocket::handleRequest(const QByteArray &requestPacket)
                    
126{
                    
                
LdapHelper.cs https://hg01.codeplex.com/mojoportal | C# | 519 lines
                    
50                //http://stackoverflow.com/questions/386982/novell-ldap-c-novell-directory-ldap-has-anybody-made-it-work
                    
51                conn.SecureSocketLayer = true;
                    
52                conn.UserDefinedServerCertValidationDelegate += new CertificateValidationCallback(LdapSSLHandler);
                    
146            }
                    
147            catch (System.Net.Sockets.SocketException ex)
                    
148            {
                    
246        //    }
                    
247        //    catch (System.Net.Sockets.SocketException ex)
                    
248        //    {
                    
                
boss_load.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 509 lines
                    
19        load_libraries/1,
                    
20        load_services_websockets/1,
                    
21        load_mail_controllers/1,
                    
37                          'view_lib_helper_modules' | 'view_lib_tags_modules' | 'view_modules'
                    
38                          | 'websocket_modules',maybe_improper_list()},...].
                    
39
                    
51-spec load_models(application()) -> {'error',[any(),...]} | {'ok',[any()]}.
                    
52-spec load_services_websockets(application()) -> {'error',[any(),...]} | {'ok',[any()]}.
                    
53-spec load_view_if_dev(application(), atom() | binary() | [atom() | [any()] | char()],_,_) -> any().
                    
74-type error(X)   :: {ok, X} | {error, string()}.
                    
75-type op_key()   :: test_modules|lib_modules|websocket_modules|mail_modules|controller_modules|
                    
76                    model_modules| view_lib_tags_modules|view_lib_helper_modules|view_modules.
                    
81     {lib_modules,             fun load_libraries/2              },
                    
82     {websocket_modules,       fun load_services_websockets/2    },
                    
83     {mail_modules,            fun load_mail_controllers/2       },
                    
                
mochiweb_request.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 0 lines
                    
61%%      <code>socket</code> is requested on a HTTPS connection, then
                    
62%%      an ssl socket will be returned as <code>{ssl, SslSocket}</code>.
                    
63%%      You can use <code>SslSocket</code> with the <code>ssl</code>
                    
67get(scheme) ->
                    
68    case mochiweb_socket:type(Socket) of
                    
69        plain ->
                    
82get(peer) ->
                    
83    case mochiweb_socket:peername(Socket) of
                    
84        {ok, {Addr={10, _, _, _}, _Port}} ->
                    
139send(Data) ->
                    
140    case mochiweb_socket:send(Socket, Data) of
                    
141        ok ->
                    
156recv(Length, Timeout) ->
                    
157    case mochiweb_socket:recv(Socket, Length, Timeout) of
                    
158        {ok, Data} ->
                    
                
misultin_http.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 0 lines
                    
67	C = #c{sock = Sock, socket_mode = SocketMode, port = ListenPort, recv_timeout = RecvTimeout, compress = CustomOpts#custom_opts.compress, stream_support = CustomOpts#custom_opts.stream_support, loop = CustomOpts#custom_opts.loop, ws_loop = CustomOpts#custom_opts.ws_loop},
                    
68	Req = #req{socket = Sock, socket_mode = SocketMode, peer_addr = PeerAddr, peer_port = PeerPort, peer_cert = PeerCert},
                    
69	% enter loop
                    
147					?LOG_DEBUG("websocket request received", []),
                    
148					misultin_websocket:connect(#ws{socket = Sock, socket_mode = SocketMode, peer_addr = Req#req.peer_addr, peer_port = Req#req.peer_port, origin = Origin, host = Host, path = Path}, WsLoop)
                    
149			end;
                    
213							misultin_socket:setopts(Sock, [{packet, http}], SocketMode),
                    
214							request(C, #req{socket = Sock, socket_mode = SocketMode, peer_addr = Req#req.peer_addr, peer_port = Req#req.peer_port, peer_cert = Req#req.peer_cert})
                    
215					end;					
                    
227									misultin_socket:setopts(Sock, [{packet, http}], SocketMode),
                    
228									request(C, #req{socket = Sock, socket_mode = SocketMode, peer_addr = Req#req.peer_addr, peer_port = Req#req.peer_port, peer_cert = Req#req.peer_cert})
                    
229							end;
                    
336% Description: Socket loop for stream responses
                    
337socket_loop(#c{sock = Sock, socket_mode = SocketMode} = C, Request) ->
                    
338	receive
                    
                
mysql_conn.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 0 lines
                    
99	  recv_pid,
                    
100	  socket,
                    
101	  data,
                    
171	    % when mysql is shutdown and takes more than 5 secs to close the
                    
172	    % listener socket.
                    
173	    ?Log2(LogFun, debug, "Ignoring message from process ~p | Reason: ~p",
                    
268	{mysql_recv, RecvPid, closed, _E} ->
                    
269	    {error, "mysql_recv: socket was closed"}
                    
270    end;
                    
278	{mysql_recv, RecvPid, closed, _E} ->
                    
279	    {error, "mysql_recv: socket was closed"}
                    
280    end.
                    
349					   recv_pid = RecvPid,
                    
350					   socket   = Sock,
                    
351					   log_fun  = LogFun,
                    
                
principe_table.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 0 lines
                    
47%% ConnectProps proplist to determine the hostname, port number and tcp
                    
48%% socket options for the connection.  Any missing parameters are filled
                    
49%% in using the module defaults.
                    
51connect(ConnectProps) ->
                    
52    {ok, Socket} = principe:connect(ConnectProps),
                    
53    % make sure we are connection to a tyrant server in table mode
                    
53    % make sure we are connection to a tyrant server in table mode
                    
54    case proplists:get_value(type, principe:stat(Socket)) of
                    
55	"table" ->
                    
55	"table" ->
                    
56	    {ok, Socket};
                    
57	_ ->
                    
64
                    
65%% @spec mget(Socket::port(),
                    
66%%            KeyList::keylist()) -> [{Key::binary(), Value::proplist()}] | error()
                    
                
principe.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 0 lines
                    
94%% ConnectProps proplist to determine the hostname, port number and tcp
                    
95%% socket options for the connection.  Any missing parameters are filled
                    
96%% in using the module defaults.
                    
108
                    
109%% @spec put(Socket::port(), 
                    
110%%           Key::key(), 
                    
115%% @end
                    
116put(Socket, Key, Value) when is_integer(Value), Value < 4294967296 ->
                    
117    put(Socket, Key, <<Value:32>>);
                    
117    put(Socket, Key, <<Value:32>>);
                    
118put(Socket, Key, Value) when is_float(Value) ->
                    
119    put(Socket, Key, <<Value:64/float>>);
                    
119    put(Socket, Key, <<Value:64/float>>);
                    
120put(Socket, Key, Value) ->
                    
121    ?T2(?PUT),							     
                    
                
changelog.rst git://github.com/pycassa/pycassa.git | ReStructuredText | 933 lines
                    
90~~~~~~~~
                    
91- Add configurable ``socket_factory`` attribute and constructor parameter
                    
92  to :class:`~.ConnectionPool` and :class:`~.SystemManager`.
                    
92  to :class:`~.ConnectionPool` and :class:`~.SystemManager`.
                    
93- Add SSL support via the new ``socket_factory`` attribute.
                    
94- Add support for :class:`~.DynamicCompositeType`
                    
                
system_manager.py git://github.com/pycassa/pycassa.git | Python | 468 lines
                    
2
                    
3from pycassa.connection import (Connection, default_socket_factory,
                    
4        default_transport_factory)
                    
69    def __init__(self, server='localhost:9160', credentials=None, framed_transport=True,
                    
70                 timeout=_DEFAULT_TIMEOUT, socket_factory=default_socket_factory,
                    
71                 transport_factory=default_transport_factory):
                    
72        self._conn = Connection(None, server, framed_transport, timeout,
                    
73                credentials, socket_factory, transport_factory)
                    
74
                    
                
pool.py git://github.com/pycassa/pycassa.git | Python | 870 lines
                    
7import random
                    
8import socket
                    
9import sys
                    
252
                    
253    socket_factory = default_socket_factory
                    
254    """ A function that creates the socket for each connection in the pool.
                    
262    """ A function that creates the transport for each connection in the pool.
                    
263    This function should take three arguments: `tsocket`, a TSocket object for the
                    
264    transport, `host`, the host the connection is being made to, and `port`,
                    
276                 prefill=True,
                    
277                 socket_factory=default_socket_factory,
                    
278                 transport_factory=default_transport_factory,
                    
336        self.timeout = timeout
                    
337        self.socket_factory = socket_factory
                    
338        self.transport_factory = transport_factory
                    
                
client.h https://bitbucket.org/rizon/ircd/ | C Header | 655 lines
                    
170
                    
171	/* client->sockhost contains the ip address gotten from the socket as a
                    
172	 * string, this field should be considered read-only once the connection
                    
175	char sockhost[HOSTIPLEN + 1];	/* This is the host name from the 
                    
176					   socket ip address as string */
                    
177	/* caller ID allow list */
                    
196	 * The following fields are allocated only for local clients
                    
197	 * (directly connected to *this* server with a socket.
                    
198	 */
                    
253	char cgisockhost[HOSTIPLEN + 1];	/* This is the host name from the 
                    
254					   socket ip address as string */
                    
255
                    
362#define FLAGS_PINGSENT      0x0000000000000001ULL	/* Unreplied ping sent                      */
                    
363#define FLAGS_DEADSOCKET    0x0000000000000002ULL	/* Local socket is dead--Exiting soon       */
                    
364#define FLAGS_KILLED        0x0000000000000004ULL	/* Prevents "QUIT" from being sent for this */
                    
                
s_auth.c https://bitbucket.org/rizon/ircd/ | C | 686 lines
                    
27 *   July 6, 1999 - Rewrote most of the code here. When a client connects
                    
28 *     to the server and passes initial socket validation checks, it
                    
29 *     is owned by this module (auth) which returns it to the rest of the
                    
91
                    
92/* We can't free AuthRequest in read_auth_reply as the underlying socket engine relies on auth->fd */
                    
93static dlink_list dead_auth_list = { NULL, NULL, 0 };
                    
250 * contact the ident server on
                    
251 * the client's host.  The connect and subsequently the socket are all put
                    
252 * into 'non-blocking' mode.  Should the connect or any later phase of the
                    
266
                    
267	/* open a socket of the same type as the client socket */
                    
268	if(comm_open(&auth->fd, auth->client->localClient->ip.ss.ss_family,
                    
270	{
                    
271		report_error(L_ALL, "creating auth stream socket %s:%s",
                    
272			     get_client_name(auth->client, SHOW_IP), errno);
                    
                
irc_res.c https://bitbucket.org/rizon/ircd/ | C | 937 lines
                    
239		if(comm_open(&ResolverFileDescriptor, irc_nsaddr_list[0].ss.ss_family,
                    
240			     SOCK_DGRAM, 0, "Resolver socket") == -1)
                    
241			return;
                    
262/*
                    
263 * restart_resolver - reread resolv.conf, reopen socket
                    
264 */
                    
                
s_bsd.c https://bitbucket.org/rizon/ircd/ | C | 835 lines
                    
80
                    
81	if((v6 = socket(AF_INET6, SOCK_STREAM, 0)) < 0)
                    
82		ServerInfo.can_use_v6 = 0;
                    
86#ifdef _WIN32
                    
87		closesocket(v6);
                    
88#else
                    
96
                    
97/* get_sockerr - get the error value from the socket or the current errno
                    
98 *
                    
114
                    
115	if(-1 < fd && !getsockopt(fd, SOL_SOCKET, SO_ERROR, (char *) &err, (socklen_t *) & len))
                    
116	{
                    
186{
                    
187	setup_socket_cb = register_callback("setup_socket", setup_socket);
                    
188	init_netio();
                    
                
client.c https://bitbucket.org/rizon/ircd/ | C | 1526 lines
                    
105 *      from == NULL,   create local client (a client connected
                    
106 *                      to a socket).
                    
107 *                      WARNING: This leaves the client in a dangerous
                    
112 *
                    
113 *      from,   create remote client (behind a socket
                    
114 *                      associated with the client defined by
                    
170		/*
                    
171		 * clean up extra sockets from P-lines which have been discarded.
                    
172		 */
                    
243		 ** Note: No need to notify opers here. It's
                    
244		 ** already done when "FLAGS_DEADSOCKET" is set.
                    
245		 */
                    
                
send.c https://bitbucket.org/rizon/ircd/ | C | 1222 lines
                    
108 ** send_message
                    
109 **      Internal utility which appends given buffer to the sockets
                    
110 **      sendq.
                    
218 ** sendq_unblocked
                    
219 **      Called when a socket is ready for writing.
                    
220 */
                    
237 ** slinkq_unblocked
                    
238 **      Called when a server control socket is ready for writing.
                    
239 */
                    
259	/*
                    
260	 ** Once socket is marked dead, we cannot start writing to it,
                    
261	 ** even if the error is removed...
                    
347	/*
                    
348	 ** Once socket is marked dead, we cannot start writing to it,
                    
349	 ** even if the error is removed...
                    
                
fileevent.lisp git://github.com/kennytilton/celtk.git | Lisp | 578 lines
                    
199;;   (tk-format-now " proc readable {channel path} {
                    
200;;      # check for async errors (sockets only, I think)
                    
201;;      if {[string length [set err [fconfigure $channel -error]]]} {
                    
232
                    
233      if {! [string compare $type \"socket\"]} {
                    
234        if {[string length [set err [fconfigure $channel -error]]]} {
                    
                
GetRequestMessageTestFixture.cs https://hg01.codeplex.com/sharpsnmplib | C# | 350 lines
                    
13using NUnit.Framework;
                    
14using System.Net.Sockets;
                    
15using System;
                    
283            //   snmp4j agent.
                    
284            Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
                    
285            GetRequestMessage message = new GetRequestMessage(0x4bed, VersionCode.V2, new OctetString("public"), new List<Variable> { new Variable(new ObjectIdentifier("1.3.6.1.2.1.1.1.0")) });
                    
287            var users = new UserRegistry();
                    
288            var ar2 = message.BeginGetResponse(new IPEndPoint(IPAddress.Loopback, 161), users, socket, null, null);
                    
289            var response = message.EndGetResponse(ar2);
                    
                
SnmpMessageExtension.cs https://hg01.codeplex.com/sharpsnmplib | C# | 634 lines
                    
145
                    
146            using (var socket = manager.GetSocket())
                    
147            {
                    
157        /// <param name="socket">The socket.</param>
                    
158        public static void Send(this ISnmpMessage message, EndPoint manager, Socket socket)
                    
159        {
                    
184            var bytes = message.ToBytes();
                    
185            socket.SendTo(bytes, 0, bytes.Length, SocketFlags.None, manager);
                    
186        }
                    
252            var bytes = message.ToBytes();
                    
253            socket.BeginSendTo(bytes, 0, bytes.Length, SocketFlags.None, manager, ar => socket.EndSendTo(ar), null);
                    
254        }
                    
327        /// <returns></returns>
                    
328        public static ISnmpMessage GetResponse(this ISnmpMessage request, int timeout, IPEndPoint receiver, Socket udpSocket)
                    
329        {
                    
                
llxmppclient.cpp https://bitbucket.org/lindenlab/viewer-xmpp/ | C++ | 1071 lines
                    
39#include "llhost.h"
                    
40#include "lliosocket.h"
                    
41#include "llmemtype.h"
                    
                
Logger.php http://owasp-esapi-php.googlecode.com/svn/trunk/ | PHP | 625 lines
                    
79		'LoggerAppenderRollingFile' => '/appenders/LoggerAppenderRollingFile.php',
                    
80		'LoggerAppenderSocket' => '/appenders/LoggerAppenderSocket.php',
                    
81		'LoggerAppenderSyslog' => '/appenders/LoggerAppenderSyslog.php',
                    
                
LoggerAppenderSocket.html http://owasp-esapi-php.googlecode.com/svn/trunk/ | HTML | 871 lines
                    
5			<!-- template designed by Marco Von Ballmoos -->
                    
6			<title>Docs For Class LoggerAppenderSocket</title>
                    
7			<link rel="stylesheet" href="../../media/stylesheet.css" />
                    
11			<div class="page-body">			

                    
12<h2 class="class-name">Class LoggerAppenderSocket</h2>
                    
13
                    
25<p class="short-description">Serialize events and send them to a network socket.</p>
                    
26<p class="description"><p>Parameters are <a href="../../log4php/appenders/LoggerAppenderSocket.html#var$remoteHost">$remoteHost</a>, <a href="../../log4php/appenders/LoggerAppenderSocket.html#var$port">$port</a>, <a href="../../log4php/appenders/LoggerAppenderSocket.html#var$timeout">$timeout</a>,  <a href="../../log4php/appenders/LoggerAppenderSocket.html#var$locationInfo">$locationInfo</a>, <a href="../../log4php/appenders/LoggerAppenderSocket.html#var$useXml">$useXml</a> and <a href="../../log4php/appenders/LoggerAppenderSocket.html#var$log4jNamespace">$log4jNamespace</a>.</p></p>
                    
27	<ul class="tags">
                    
31		<p class="notes">
                    
32			Located in <a class="field" href="_appenders---LoggerAppenderSocket.php.html">/appenders/LoggerAppenderSocket.php</a> (line <span class="field">37</span>)
                    
33		</p>
                    
39      |
                    
40      --LoggerAppenderSocket</pre>
                    
41	
                    
                
LoggerAppenderSkeleton.html http://owasp-esapi-php.googlecode.com/svn/trunk/ | HTML | 1262 lines
                    
116								<tr>
                    
117					<td style="padding-right: 2em"><a href="../log4php/appenders/LoggerAppenderSocket.html">LoggerAppenderSocket</a></td>
                    
118					<td>
                    
118					<td>
                    
119											Serialize events and send them to a network socket.
                    
120										</td>
                    
                
elementindex.html http://owasp-esapi-php.googlecode.com/svn/trunk/ | HTML | 5149 lines
                    
113		<dd class="index-item-body">
                    
114			<div class="index-item-details"><a href="log4php/appenders/LoggerAppenderSocket.html#methodactivateOptions">LoggerAppenderSocket::activateOptions()</a> in LoggerAppenderSocket.php</div>
                    
115							<div class="index-item-description">Create a socket connection using defined parameters</div>
                    
                
li_log4php.html http://owasp-esapi-php.googlecode.com/svn/trunk/ | HTML | 246 lines
                    
74															<dd><a href='log4php/appenders/LoggerAppenderRollingFile.html' target='right'>LoggerAppenderRollingFile</a></dd>
                    
75															<dd><a href='log4php/appenders/LoggerAppenderSocket.html' target='right'>LoggerAppenderSocket</a></dd>
                    
76															<dd><a href='log4php/appenders/LoggerAppenderSyslog.html' target='right'>LoggerAppenderSyslog</a></dd>
                    
88															<dd><a href='log4php/appenders/_appenders---LoggerAppenderRollingFile.php.html' target='right'>LoggerAppenderRollingFile.php</a></dd>
                    
89															<dd><a href='log4php/appenders/_appenders---LoggerAppenderSocket.php.html' target='right'>LoggerAppenderSocket.php</a></dd>
                    
90															<dd><a href='log4php/appenders/_appenders---LoggerAppenderSyslog.php.html' target='right'>LoggerAppenderSyslog.php</a></dd>
                    
                
POIFSDocumentReader.cs https://npoi.svn.codeplex.com/svn | C# | 453 lines
                    
106        /// <summary>
                    
107        /// Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
                    
108        /// </summary>
                    
                
http_test.php git://github.com/swiftmailer/swiftmailer.git | PHP | 424 lines
                    
22    function testDefaultGetRequest() {
                    
23        $socket = new MockSimpleSocket();
                    
24        $socket->expectAt(0, 'write', array("GET /here.html HTTP/1.0\r\n"));
                    
69        $route = new PartialSimpleRoute();
                    
70        $route->setReturnReference('createSocket', $socket);
                    
71        $route->__construct(new SimpleUrl('http://a.valid.host/here.html?a=1&b=2'));
                    
257    function testContentHeadersCalculated() {
                    
258        $socket = new MockSimpleSocket();
                    
259        $socket->expectAt(0, 'write', array("Content-Length: 3\r\n"));
                    
336    function testBadRequest() {
                    
337        $socket = new MockSimpleSocket();
                    
338        $socket->setReturnValue('getSent', '');
                    
347    function testBadSocketDuringResponse() {
                    
348        $socket = new MockSimpleSocket();
                    
349        $socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n");
                    
                
http.php git://github.com/swiftmailer/swiftmailer.git | PHP | 628 lines
                    
71     *    @param integer $timeout    Connection timeout.
                    
72     *    @return SimpleSocket       New socket.
                    
73     *    @access public
                    
76        $default_port = ('https' == $this->url->getScheme()) ? 443 : 80;
                    
77        $socket = $this->createSocket(
                    
78                $this->url->getScheme() ? $this->url->getScheme() : 'http',
                    
95     *    @param integer $timeout                 Connection timeout.
                    
96     *    @return SimpleSocket/SimpleSecureSocket New socket.
                    
97     *    @access protected
                    
236     *    Sends the headers.
                    
237     *    @param SimpleSocket $socket           Open socket.
                    
238     *    @param string $method                 HTTP request method,
                    
276     *    Wraps the socket in a response parser.
                    
277     *    @param SimpleSocket $socket   Responding socket.
                    
278     *    @return SimpleHttpResponse    Parsed response object.
                    
                
xmpp.scm git://github.com/gemmat/Gauche-XMPP.git | Scheme | 528 lines
                    
88(define-class <xmpp-connection> ()
                    
89  ((socket          :init-keyword :socket)
                    
90   (socket-iport    :init-keyword :socket-iport)
                    
90   (socket-iport    :init-keyword :socket-iport)
                    
91   (socket-oport    :init-keyword :socket-oport)
                    
92   (id)
                    
107          (ref conn 'port)
                    
108          (socket-status (ref conn 'socket))))
                    
109
                    
138                      (xml:lang        #f))
                    
139    (let* ((socket (make-client-socket 'inet hostname port))
                    
140           (conn (make <xmpp-connection>
                    
141                   :socket          socket
                    
142                   :socket-iport   (socket-input-port  socket :buffering :none)
                    
143                   :socket-oport   (socket-output-port socket)
                    
                
Item.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 691 lines
                    
132        int equipmentSlot, int itemLocation, int enchant, int itemSkin,
                    
133        int fusionedItem, int optionalSocket, int optionalFusionSocket, Timestamp expireTime)
                    
134    {
                    
148        this.itemSkinTemplate = DataManager.ITEM_DATA.getItemTemplate(itemSkin);
                    
149        this.optionalSocket = optionalSocket;
                    
150        this.optionalFusionSocket = optionalFusionSocket;
                    
164
                    
165    public int getOptionalSocket() {
                    
166        return optionalSocket;
                    
175    public void setOptionalSocket(int optionalSocket) {
                    
176        this.optionalSocket = optionalSocket;
                    
177    }
                    
189    public void setOptionalFusionSocket(int optionalFusionSocket) {
                    
190        this.optionalFusionSocket = optionalFusionSocket;
                    
191    }
                    
                
ItemService.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 809 lines
                    
95        if (itemTemplate.isWeapon() || itemTemplate.isArmor()) {
                    
96            temp.setOptionalSocket(Rnd.get(0, itemTemplate.getOptionSlotBonus()));
                    
97        }
                    
                
EnchantService.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 912 lines
                    
224            // Retail: http://powerwiki.na.aiononline.com/aion/Patch+Notes:+1.9.0.1
                    
225            // When socketing fails at +11~+15, the value falls back to +10.
                    
226            if (currentEnchant > 10)
                    
273     */
                    
274    public static boolean socketManastone(Player player, Item parentItem, Item targetItem, Item supplementItem, int targetWeapon) {
                    
275        // Check that parentItem is still in Inventory.
                    
322        if (targetWeapon == 1) {
                    
323            if (stoneCount >= targetItem.getSockets(false))
                    
324                successRate = EnchantsConfig.MSPERCENT5;
                    
325        } else {
                    
326            if (stoneCount >= targetItem.getSockets(true))
                    
327                successRate = EnchantsConfig.MSPERCENT5;
                    
                
MySQL5InventoryDAO.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 490 lines
                    
50    public static final String INSERT_QUERY = "INSERT INTO `inventory` (`itemUniqueId`, `itemId`, `itemCount`, `itemColor`, `itemOwner`, `isEquiped`, isSoulBound, `slot`, `itemLocation`, `enchant`, `itemCreator`, `itemSkin`, `fusionedItem`, `optionalSocket`, `optionalFusionSocket`, `expireTime`) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                    
51    public static final String UPDATE_QUERY = "UPDATE `inventory` SET  `itemCount`=?, `itemColor`=?, `itemOwner`=?, `isEquiped`=?, `isSoulBound`=?, `slot`=?, `itemLocation`=?, `enchant`=?, `itemCreator`=?, `itemSkin`=?, `fusionedItem`=?, `optionalSocket`=?, `optionalFusionSocket`=?, `expireTime`=? WHERE `itemUniqueId`=?";
                    
52    public static final String DELETE_QUERY = "DELETE FROM `inventory` WHERE `itemUniqueId`=?";
                    
87                int fusionedItem = rset.getInt("fusionedItem");
                    
88                int optionalSocket = rset.getInt("optionalSocket");
                    
89                int optionalFusionSocket = rset.getInt("optionalFusionSocket");
                    
147                int optionalSocket = rset.getInt("optionalSocket");
                    
148                int optionalFusionSocket = rset.getInt("optionalFusionSocket");
                    
149                Timestamp expireTime;
                    
158                    itemCreator, true, (isSoulBound == 1), slot, storage, enchant,
                    
159                    itemSkin, fusionedItem, optionalSocket, optionalFusionSocket, expireTime);
                    
160                item.setPersistentState(PersistentState.UPDATED);
                    
214                    itemCreator, true, (isSoulBound == 1), slot, storage, enchant,
                    
215                    itemSkin, fusionedItem, optionalSocket, optionalFusionSocket, expireTime);
                    
216                items.add(item);
                    
                
MySQL5LegionDAO.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 562 lines
                    
82     */
                    
83    private static final String SELECT_STORAGE_QUERY = "SELECT `itemUniqueId`, `itemId`, `itemCount`, `itemColor`, `isEquiped`, `slot`, `enchant`, `itemCreator`, `itemSkin`, `fusionedItem`, `optionalSocket`, `optionalFusionSocket`, `expireTime` FROM `inventory` WHERE `itemOwner`=? AND `itemLocation`=? AND `isEquiped`=?";
                    
84
                    
                
aionx_gs.sql http://aionxemu.googlecode.com/svn/trunk/ | SQL | 797 lines
                    
179  `fusionedItem` int(11) NOT NULL DEFAULT '0',
                    
180  `optionalSocket` int(1) NOT NULL DEFAULT '0',
                    
181  `optionalFusionSocket` int(1) NOT NULL DEFAULT '0',
                    
                
Reader.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 474 lines
                    
48    private Worker w;
                    
49    private SocketChannel sc = null;
                    
50    private int read = 0, bufferSize = 0, oldLimit = 0, totalRead = 0, maxTries = 3, tries = 0, retrySelection;
                    
                
dTubes.py http://damnvid.googlecode.com/svn/trunk/ | Python | 630 lines
                    
14import BeautifulSoup
                    
15DV.blanksocket = socket.socket
                    
16DV.youtube_service = gdata.youtube.service.YouTubeService()
                    
34	DV.cookiejar = DamnCookieJar()
                    
35	newSocket = DV.blanksocket
                    
36	proxy = DV.prefs.gets('damnvid-proxy', 'proxy')
                    
75			Damnlog('SOCKS proxy port is not a valid integer.')
                    
76		newSocket = socks.socksocket
                    
77	else:
                    
79		Damnlog('Using system settings, set proxy handle to', proxy)
                    
80	Damnlog('Reloading urllib2, setting socket to', newSocket)
                    
81	del urllib2
                    
81	del urllib2
                    
82	socket.socket = newSocket
                    
83	import urllib2
                    
                
flexcdc.php http://flexviews.googlecode.com/svn/trunk/ | PHP | 1281 lines
                    
136			case 'source': 
                    
137				/*TODO: support unix domain sockets */
                    
138				$handle = mysql_connect($S['host'] . ':' . $S['port'], $S['user'], $S['password'], true) or die1('Could not connect to MySQL server:' . mysql_error());
                    
181		
                    
182		#build the command line from user, host, password, socket options in the ini file in the [source] section
                    
183		foreach($settings['source'] as $k => $v) {
                    
                
test_client.lua git://github.com/nrk/redis-lua.git | Lua | 2645 lines
                    
171    sleep = function(sec)
                    
172        socket.select(nil, nil, sec)
                    
173    end,
                    
224        assert_type(client, 'table')
                    
225        assert_true(table.contains(table.keys(client.network), 'socket'))
                    
226
                    
226
                    
227        client.network.socket:send("PING\r\n")
                    
228        assert_equal(client.network.socket:receive('*l'), '+PONG')
                    
247
                    
248    test("Can use an already connected socket", function()
                    
249        local connection = require('socket').tcp()
                    
251
                    
252        local client = redis.connect({ socket = connection })
                    
253        assert_type(client, 'table')
                    
                
redis.lua git://github.com/nrk/redis-lua.git | Lua | 1203 lines
                    
284
                    
285local function create_client(proto, client_socket, commands)
                    
286    local client = load_methods(proto, commands)
                    
288    client.network = {
                    
289        socket = client_socket,
                    
290        read   = network.read,
                    
301function network.write(client, buffer)
                    
302    local _, err = client.network.socket:send(buffer)
                    
303    if err then client.error(err) end
                    
494    local table_insert = table.insert
                    
495    local socket_write, socket_read = client.network.write, client.network.read
                    
496
                    
523
                    
524    client.network.write, client.network.read = socket_write, socket_read
                    
525    if not success then client.error(retval, 0) end
                    
                
mysql.h https://bitbucket.org/oneb1t/crocoduckcore/ | C++ Header | 870 lines
                    
62
                    
63#ifndef my_socket_defined
                    
64#ifdef __WIN__
                    
64#ifdef __WIN__
                    
65#define my_socket SOCKET
                    
66#else
                    
66#else
                    
67typedef int my_socket;
                    
68#endif /* __WIN__ */
                    
68#endif /* __WIN__ */
                    
69#endif /* my_socket_defined */
                    
70#endif /* _global_h */
                    
178  unsigned long client_flag;
                    
179  char *host,*user,*password,*unix_socket,*db;
                    
180  struct st_dynamic_array *init_commands;
                    
                
Database.cpp https://bitbucket.org/oneb1t/crocoduckcore/ | C++ | 603 lines
                    
98
                    
99    std::string host, port_or_socket, user, password, database;
                    
100    int port;
                    
100    int port;
                    
101    char const* unix_socket;
                    
102
                    
107    if (iter != tokens.end())
                    
108        port_or_socket = *iter++;
                    
109    if (iter != tokens.end())
                    
122        port = 0;
                    
123        unix_socket = 0;
                    
124    }
                    
136        port = 0;
                    
137        unix_socket = port_or_socket.c_str();
                    
138    }
                    
                
Master.cpp https://bitbucket.org/oneb1t/crocoduckcore/ | C++ | 543 lines
                    
42
                    
43#include "sockets/TcpSocket.h"
                    
44#include "sockets/Utility.h"
                    
47#include "sockets/SocketHandler.h"
                    
48#include "sockets/ListenSocket.h"
                    
49
                    
126        // Launch the RA listener socket
                    
127        ListenSocket<RASocket> RAListenSocket (h);
                    
128        bool usera = sConfig.GetBoolDefault ("Ra.Enable", false);
                    
147        // Socket Select time is in microseconds , not miliseconds!!
                    
148        uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
                    
149
                    
298
                    
299    uint32 socketSelecttime = sWorld.getConfig(CONFIG_SOCKET_SELECTTIME);
                    
300
                    
                
World.h https://bitbucket.org/oneb1t/crocoduckcore/ | C Header | 730 lines
                    
44class QueryResult;
                    
45class WorldSocket;
                    
46
                    
96    CONFIG_PORT_WORLD,
                    
97    CONFIG_SOCKET_SELECTTIME,
                    
98    CONFIG_SOCKET_TIMEOUTTIME,
                    
                
WorldSession.cpp https://bitbucket.org/oneb1t/crocoduckcore/ | C++ | 579 lines
                    
69    {
                    
70        m_Socket->CloseSocket();
                    
71        m_Socket->RemoveReference();
                    
138    if (m_Socket->SendPacket(*packet) == -1)
                    
139        m_Socket->CloseSocket();
                    
140}
                    
174    if (IsConnectionIdle())
                    
175        m_Socket->CloseSocket();
                    
176
                    
179    WorldPacket* packet;
                    
180    while (m_Socket && !m_Socket->IsClosed() && _recvQueue.next(packet))
                    
181    {
                    
260    // Cleanup socket pointer if need
                    
261    if (m_Socket && m_Socket->IsClosed())
                    
262    {
                    
                
ContentServerClient.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 674 lines
                    
93
                    
94                byte success = this.Socket.Reader.ReadByte();
                    
95
                    
236            ContentServerClient client;
                    
237            TcpSocket Socket { get { return client.Socket; } }
                    
238
                    
280                // the client probably performs a sanity check?
                    
281                uint connId = NetHelpers.EndianSwap( this.Socket.Reader.ReadUInt32() );
                    
282                uint msgId = NetHelpers.EndianSwap( this.Socket.Reader.ReadUInt32() );
                    
327
                    
328                uint manifestLength = NetHelpers.EndianSwap( this.Socket.Reader.ReadUInt32() );
                    
329                byte[] manifest = new byte[ manifestLength ];
                    
342                    {
                    
343                        uint socketRead = ( uint )this.Socket.Reader.Read( manifest, ( int )( ( manifestLength - manifestChunksToRead ) + ( chunkLen - toRead ) ), ( int )toRead );
                    
344                        toRead = toRead - socketRead;
                    
                
UdpConnection.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 573 lines
                    
11using System.Net;
                    
12using System.Net.Sockets;
                    
13using System.Threading;
                    
53        private Thread netThread;
                    
54        private Socket sock;
                    
55        private IPEndPoint remoteEndPoint;
                    
96
                    
97            sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
                    
98            sock.Bind(localEndPoint);
                    
148
                    
149            // Advance this the same way that steam does, when a socket gets reused.
                    
150            sourceConnId += 256;
                    
242            }
                    
243            catch ( SocketException e )
                    
244            {
                    
                
CMClient.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 510 lines
                    
11using System.Net;
                    
12using System.Net.Sockets;
                    
13using System.Collections.ObjectModel;
                    
242            }
                    
243            catch ( SocketException )
                    
244            {
                    
                
ContentDownloader.cs https://bitbucket.org/VoiDeD/steamre/ | C# | 1158 lines
                    
5using System.Net;
                    
6using System.Net.Sockets;
                    
7using System.Text;
                    
                
cthelper.c http://futty.googlecode.com/svn/trunk/ | C | 808 lines
                    
7#include <utmp.h>
                    
8#include <sys/socket.h>
                    
9#include <netinet/in.h>
                    
54  DBUG_ENTER("connect_cygterm");
                    
55  if (0 <= (sock = socket(PF_INET, SOCK_STREAM, 0))) {
                    
56    sa.sin_family = AF_INET;
                    
512    c,      /* control descriptor (stdin) */
                    
513    s;      /* socket descriptor (PuTTY) */
                    
514  Buffer
                    
516    pbuf,   /* pty buffer */
                    
517    sbuf;   /* socket buffer */
                    
518
                    
                
winnet.c http://futty.googlecode.com/svn/trunk/ | C | 1734 lines
                    
27/*
                    
28 * We used to typedef struct Socket_tag *Socket.
                    
29 *
                    
30 * Since we have made the networking abstraction slightly more
                    
31 * abstract, Socket no longer means a tcp socket (it could mean
                    
32 * an ssl socket).  So now we must use Actual_Socket when we know
                    
34 */
                    
35typedef struct Socket_tag *Actual_Socket;
                    
36
                    
122{
                    
123    Actual_Socket a = (Actual_Socket) av, b = (Actual_Socket) bv;
                    
124    unsigned long as = (unsigned long) a->s, bs = (unsigned long) b->s;
                    
386      case WSAENOTSOCK:
                    
387	return "Network error: Socket operation on non-socket";
                    
388      case WSAEOPNOTSUPP:
                    
                
Ftp.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 616 lines
                    
31#include <SFML/Network/Export.hpp>
                    
32#include <SFML/Network/TcpSocket.hpp>
                    
33#include <SFML/System/NonCopyable.hpp>
                    
130            InvalidResponse  = 1000, //!< Not part of the FTP standard, generated by SFML when a received response cannot be parsed
                    
131            ConnectionFailed = 1001, //!< Not part of the FTP standard, generated by SFML when the low-level socket connection with the server fails
                    
132            ConnectionClosed = 1002, //!< Not part of the FTP standard, generated by SFML when the low-level socket connection is unexpectedly closed
                    
                
Http.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 482 lines
                    
32#include <SFML/Network/IpAddress.hpp>
                    
33#include <SFML/Network/TcpSocket.hpp>
                    
34#include <SFML/System/NonCopyable.hpp>
                    
                
Packet.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 545 lines
                    
38class String;
                    
39class TcpSocket;
                    
40class UdpSocket;
                    
349
                    
350    friend class TcpSocket;
                    
351    friend class UdpSocket;
                    
                
Ftp.cpp git://github.com/LaurentGomila/SFML.git | C++ | 653 lines
                    
63    Ftp&      m_ftp;        //!< Reference to the owner Ftp instance
                    
64    TcpSocket m_dataSocket; //!< Socket used for data transfers
                    
65};
                    
153    // Connect to the server
                    
154    if (m_commandSocket.connect(server, port, timeout) != Socket::Done)
                    
155        return Response(Response::ConnectionFailed);
                    
185    if (response.isOk())
                    
186        m_commandSocket.disconnect();
                    
187
                    
374    // Send it to the server
                    
375    if (m_commandSocket.send(commandStr.c_str(), commandStr.length()) != Socket::Done)
                    
376        return Response(Response::ConnectionClosed);
                    
400        {
                    
401            if (m_commandSocket.receive(buffer, sizeof(buffer), length) != Socket::Done)
                    
402                return Response(Response::ConnectionClosed);
                    
                
sockets.py https://bitbucket.org/excieve/pyhs/ | Python | 512 lines
                    
66    def connect(self):
                    
67        """Establishes connection with a new socket. If some socket is
                    
68        associated with the instance - no new socket will be created.
                    
73        try:
                    
74            sock = socket.socket(self.protocol, socket.SOCK_STREAM)
                    
75            # Disable Nagle algorithm to improve latency:
                    
76            # http://developers.slashdot.org/comments.pl?sid=174457&threshold=1&commentsort=0&mode=thread&cid=14515105
                    
77            sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
                    
78            sock.settimeout(self.timeout)
                    
178       Shouldn't be used directly in most cases.
                    
179       Use :class:`~.ReadSocket` for read operations and :class:`~.WriteSocket` for
                    
180       writes.
                    
397
                    
398class ReadSocket(HandlerSocket):
                    
399    """HandlerSocket client for read operations."""
                    
                
DownloadPictures.java http://magic--another-game-engine.googlecode.com/svn/trunk/ | Java | 527 lines
                    
14import java.io.InputStreamReader;
                    
15import java.net.InetSocketAddress;
                    
16import java.net.Proxy;
                    
410			try {
                    
411				p = new Proxy(types[type], new InetSocketAddress(addr.getText(), Integer.parseInt(port.getText())));
                    
412			} catch (Exception ex) {
                    
                
socket.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 0 lines
                    
164    import sys
                    
165    if "socket" in sys.modules and sys.modules["socket"] is not stdsocket:
                    
166        raise RuntimeError("Use 'stacklesssocket.install' instead of replacing the 'socket' module")
                    
167
                    
168_realsocket_old = stdsocket._realsocket
                    
169_socketobject_old = stdsocket._socketobject
                    
207    stdsocket._realsocket = socket
                    
208    stdsocket.socket = stdsocket.SocketType = stdsocket._socketobject = _socketobject_new
                    
209    if pi is not None:
                    
213    stdsocket._realsocket = _realsocket_old
                    
214    stdsocket.socket = stdsocket.SocketType = stdsocket._socketobject = _socketobject_old
                    
215
                    
279        def handle_connect_event(self):
                    
280            err = self.socket.getsockopt(stdsocket.SOL_SOCKET, stdsocket.SO_ERROR)
                    
281            if err != 0:
                    
                
stacklesswsgi.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 849 lines
                    
152        self.addr = addr
                    
153        self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
                    
154        self.bind(addr)
                    
176            s, a = asyncore.dispatcher.accept(self)
                    
177            s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
                    
178            s = sock_channel(s)
                    
188        by sock_server"""
                    
189        if sock.type == socket.SOCK_DGRAM:
                    
190            raise NotImplementedError("sock_channel can only handle TCP sockets")
                    
204        if self.send_buffer is None:
                    
205            raise socket.error(socket.EBADF, "Connection closed")
                    
206        self.send_buffer += data
                    
214        if self.send_buffer is None:
                    
215            raise socket.error(socket.EBADF, "Connection closed")
                    
216        self.send_buffer += data
                    
                
stacklesssocket30.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 583 lines
                    
31import asyncore, weakref
                    
32import socket as stdsocket # We need the "socket" name for the function we export.
                    
33
                    
34# Cache socket module entries we may monkeypatch.
                    
35_old_socket = stdsocket.socket
                    
36_old_SocketIO = stdsocket.SocketIO
                    
36_old_SocketIO = stdsocket.SocketIO
                    
37_old_realsocket = stdsocket._realsocket
                    
38
                    
39def install():
                    
40    if stdsocket.socket is _new_socket:
                    
41        raise RuntimeError("Still installed")
                    
104    import sys
                    
105    if "socket" in sys.modules and sys.modules["socket"] is not stdsocket:
                    
106        raise RuntimeError("Use 'stacklesssocket.install' instead of replacing the 'socket' module")
                    
                
stacklesssocket.py http://stacklessexamples.googlecode.com/svn/trunk/ | Python | 911 lines
                    
157
                    
158_realsocket_old = stdsocket._realsocket
                    
159_socketobject_old = stdsocket._socketobject
                    
197    stdsocket._realsocket = socket
                    
198    stdsocket.socket = stdsocket.SocketType = stdsocket._socketobject = _socketobject_new
                    
199    if pi is not None:
                    
203    stdsocket._realsocket = _realsocket_old
                    
204    stdsocket.socket = stdsocket.SocketType = stdsocket._socketobject = _socketobject_old
                    
205
                    
269        def handle_connect_event(self):
                    
270            err = self.socket.getsockopt(stdsocket.SOL_SOCKET, stdsocket.SO_ERROR)
                    
271            if err != 0:
                    
293        if not isinstance(realSocket, _realsocket_old):
                    
294            raise StandardError("An invalid socket passed to fakesocket %s" % realSocket.__class__)
                    
295
                    
                
SOCK_Acceptor.cpp https://bitbucket.org/oregon/oregoncore/ | C++ | 418 lines
                    
5#include "ace/OS_NS_string.h"
                    
6#include "ace/OS_NS_sys_socket.h"
                    
7#include "ace/os_include/os_fcntl.h"
                    
91    // Reset the event association inherited by the new handle.
                    
92    ::WSAEventSelect ((SOCKET) new_handle, 0, 0);
                    
93#else
                    
197      // Reset the size of the addr, which is only necessary for UNIX
                    
198      // domain sockets.
                    
199      if (new_stream.get_handle () != ACE_INVALID_HANDLE
                    
243# if defined (ACE_WIN32)
                    
244      // on windows vista and later, Winsock can support dual stack sockets
                    
245      // but this must be explicitly set prior to the bind. Since this
                    
                
EnchantItemAction.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 89 lines
                    
78                        } else {
                    
79                            boolean result = EnchantService.socketManastone(player, parentItem, targetItem, supplementItem, targetWeapon);
                    
80                            PacketSendUtility.sendPacket(player, new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), parentItem
                    
                
mvar.erl git://github.com/evanmiller/ChicagoBoss.git | Erlang | 0 lines
                    
1% A mvar is a process that holds a value (its content) and provides exclusive access to it. When a mvar terminates it executes it given finalize procedure, which is needed for content that needs to clean up when terminating. When a mvar is created it executes its supplied initialize procedure, which creates the initial content from within the mvar process so if the initial content is another linked dependent process (such as a socket) it will terminate when the mvar terminates without the need for a finalizer. A mvar itself dependently links to its parent process (the process that created it) and thus terminates when its parent process terminates.
                    
2-module (mvar).
                    
                
ListenSocket.h https://bitbucket.org/oregon/oregoncore/ | C Header | 0 lines
                    
29*/
                    
30#ifndef _SOCKETS_ListenSocket_H
                    
31#define _SOCKETS_ListenSocket_H
                    
63        \param use_creator Optional use of creator (default true) */
                    
64    ListenSocket(ISocketHandler& h,bool use_creator = true) : Socket(h), m_depth(0), m_creator(NULL)
                    
65    ,m_bHasCreate(false)
                    
392        "accept()" is handled automatically in the OnRead() method. */
                    
393        virtual SOCKET Accept(SOCKET socket, struct sockaddr *saptr, socklen_t *lenptr)
                    
394        {
                    
404protected:
                    
405    ListenSocket(const ListenSocket& s) : Socket(s) {}
                    
406private:
                    
406private:
                    
407    ListenSocket& operator=(const ListenSocket& ) { return *this; }
                    
408    int m_depth;
                    
                
ofxTCPClient.cpp git://github.com/openframeworks/openFrameworks.git | C++ | 371 lines
                    
233bool ofxTCPClient::isClosingCondition(int messageSize, int errorCode){
                    
234	return (messageSize == SOCKET_ERROR && (errorCode == OFXNETWORK_ERROR(CONNRESET) || errorCode == OFXNETWORK_ERROR(CONNABORTED) || errorCode == OFXNETWORK_ERROR(CONNREFUSED) || errorCode == EPIPE || errorCode == OFXNETWORK_ERROR(NOTCONN)))
                    
235		|| (messageSize == 0 && !TCPClient.IsNonBlocking() && TCPClient.GetTimeoutReceive()!=NO_TIMEOUT);
                    
                
SocketReactor.h git://github.com/openframeworks/openFrameworks.git | C Header | 238 lines
                    
73	/// Once started, the SocketReactor waits for events
                    
74	/// on the registered sockets, using Socket::select().
                    
75	/// If an event is detected, the corresponding event handler
                    
152
                    
153	void addEventHandler(const Socket& socket, const Poco::AbstractObserver& observer);
                    
154		/// Registers an event handler with the SocketReactor.
                    
160	bool hasEventHandler(const Socket& socket, const Poco::AbstractObserver& observer);
                    
161		/// Returns true if the observer is reistered with SocketReactor for the given socket.
                    
162
                    
162
                    
163	void removeEventHandler(const Socket& socket, const Poco::AbstractObserver& observer);
                    
164		/// Unregisters an event handler with the SocketReactor.
                    
198
                    
199	void dispatch(const Socket& socket, SocketNotification* pNotification);
                    
200		/// Dispatches the given notification to all observers
                    
                
TestJmxMonitoredMap.java git://github.com/apache/lucene-solr.git | Java | 218 lines
                    
36import java.lang.invoke.MethodHandles;
                    
37import java.net.ServerSocket;
                    
38import java.rmi.registry.LocateRegistry;
                    
38import java.rmi.registry.LocateRegistry;
                    
39import java.rmi.server.RMIServerSocketFactory;
                    
40import java.util.Set;
                    
73      System.setProperty("java.rmi.server.hostname", "127.0.0.1");
                    
74      class LocalhostRMIServerSocketFactory implements RMIServerSocketFactory {
                    
75        ServerSocket socket;
                    
77        @Override
                    
78        public ServerSocket createServerSocket(int port) throws IOException {
                    
79          return socket = new ServerSocket(port);
                    
81      };
                    
82      LocalhostRMIServerSocketFactory factory = new LocalhostRMIServerSocketFactory();
                    
83      LocateRegistry.createRegistry(0, null, factory);
                    
                
functions-http.php http://yourls.googlecode.com/svn/trunk/ | PHP | 191 lines
                    
93	
                    
94	$initial_timeout = @ini_set( 'default_socket_timeout', $timeout );
                    
95	$initial_user_agent = @ini_set( 'user_agent', yourls_http_user_agent() );
                    
109	if( $initial_timeout !== false )
                    
110		@ini_set( 'default_socket_timeout', $initial_timeout ); 
                    
111	if( $initial_user_agent !== false )
                    
                
MySQL5MailDAO.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 272 lines
                    
120                    int fusionedItem = rset.getInt("fusionedItem");
                    
121                    int optionalSocket = rset.getInt("optionalSocket");
                    
122                    int optionalFusionSocket = rset.getInt("optionalFusionSocket");
                    
126                        (isSoulBound == 1), slot, StorageType.MAILBOX.getId(),
                    
127                        enchant, itemSkin, fusionedItem, optionalSocket,
                    
128                        optionalFusionSocket, expireTime);
                    
                
UdpSocket.hpp git://github.com/LaurentGomila/SFML.git | C++ Header | 291 lines
                    
44////////////////////////////////////////////////////////////
                    
45class SFML_NETWORK_API UdpSocket : public Socket
                    
46{
                    
208///
                    
209/// A UDP socket is a connectionless socket. Instead of
                    
210/// connecting once to a remote host, like TCP sockets,
                    
254/// // Create a socket and bind it to the port 55001
                    
255/// sf::UdpSocket socket;
                    
256/// socket.bind(55001);
                    
272/// // Create a socket and bind it to the port 55002
                    
273/// sf::UdpSocket socket;
                    
274/// socket.bind(55002);
                    
288///
                    
289/// \see sf::Socket, sf::TcpSocket, sf::Packet
                    
290///
                    
                
internets.pas git://github.com/moparisthebest/Simba.git | Pascal | 447 lines
                    
67    procedure Info(out IP, Port: string);
                    
68    constructor Create(Owner: TObject; Socket: TTCPBlockSocket = nil);
                    
69    destructor Destroy; override;
                    
78    function CreateSocket: integer;
                    
79    function CreateSocketEx(Socket: TTCPBlockSocket): integer;
                    
80    function GetSocket(Index: integer): TSock;
                    
306
                    
307function TSocks.CreateSocketEx(Socket: TTCPBlockSocket): integer;
                    
308begin;
                    
417  Socket := TTCPBlockSocket.Create;
                    
418  Socket.Socket := Sock.Accept;
                    
419  Result := Socket;
                    
429
                    
430constructor TSock.Create(Owner: TObject; Socket: TTCPBlockSocket = nil);
                    
431begin
                    
                
NATNetworks.java http://ambienttalk.googlecode.com/svn/ | Java | 251 lines
                    
52import java.net.NetworkInterface;
                    
53import java.net.SocketException;
                    
54import java.util.ArrayList;
                    
                
Plugin.php http://typecho.googlecode.com/svn/trunk/ | PHP | 214 lines
                    
88        
                    
89        $client = Typecho_Http_Client::get('Curl', 'Socket');
                    
90        if (false != $client) {
                    
                
FLONIUserTrackingSocket.as http://as3openni.googlecode.com/svn/trunk/ | ActionScript | 272 lines
                    
10	
                    
11	public class FLONIUserTrackingSocket extends FLBasicSocket
                    
12	{
                    
12	{
                    
13		public static const OPEN_NI_USER_TRACKING_SOCKET:String = "open_ni_user_tracking_socket";
                    
14		
                    
14		
                    
15		public function FLONIUserTrackingSocket()
                    
16		{
                    
30				{
                    
31					var arr1:Array = this.socketMessage.split(':');
                    
32					var newUser:Number = Number(arr1[1]);
                    
44				// Detect for user pose detected.
                    
45				if(this.socketMessage.substr(0, ONIUserTrackingEvent.USER_TRACKING_POSE_DETECTED.length) == ONIUserTrackingEvent.USER_TRACKING_POSE_DETECTED)
                    
46				{
                    
                
Server.cs http://xe8tmw7c.googlecode.com/svn/ | C# | 246 lines
                    
225                //On ferme le port ouvert par Upnp
                    
226                NAT.DeleteForwardingRule(this.netConf.Port, System.Net.Sockets.ProtocolType.Udp);
                    
227            }
                    
                
ppc-linux-os.c git://github.com/sbcl/sbcl.git | C | 187 lines
                    
28#include "lispregs.h"
                    
29#include <sys/socket.h>
                    
30#include <sys/utsname.h>
                    
                
ControllerThreadSocketFactory.java http://google-enterprise-connector-sharepoint.googlecode.com/svn/trunk/ | Java | 165 lines
                    
90                public void doit() throws IOException {
                    
91                    setSocket(socketfactory.createSocket(host, port, localAddress, localPort));
                    
92                }                 
                    
100            }
                    
101            Socket socket = task.getSocket();
                    
102            if (task.exception != null) {
                    
107
                    
108    public static Socket createSocket(final SocketTask task, int timeout)
                    
109     throws IOException, UnknownHostException, ConnectTimeoutException
                    
117            }
                    
118            Socket socket = task.getSocket();
                    
119            if (task.exception != null) {
                    
137         */
                    
138        protected void setSocket(final Socket newSocket) {
                    
139            socket = newSocket;
                    
                
swank-kawa.scm https://bitbucket.org/sakito/dot.emacs.d/ | Scheme | 0 lines
                    
20	       "-cp" "/opt/kawa/kawa-svn:/opt/java/jdk1.6.0/lib/tools.jar"
                    
21	       "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n"
                    
22	       "kawa.repl" "-s")
                    
276
                    
277(define-alias <server-socket> <java.net.ServerSocket>)
                    
278(define-alias <socket> <java.net.Socket>)
                    
324(df start-swank (port-file)
                    
325  (let ((announce (fun ((socket <server-socket>))
                    
326                    (with (f (call-with-output-file port-file))
                    
326                    (with (f (call-with-output-file port-file))
                    
327                      (format f "~d\n" (! get-local-port socket))))))
                    
328    (spawn (fun ()
                    
341
                    
342(df announce-port ((socket <server-socket>))
                    
343  (log "Listening on port: ~d\n" (! get-local-port socket)))
                    
                
swank-lispworks.lisp https://bitbucket.org/sakito/dot.emacs.d/ | Lisp | 0 lines
                    
69
                    
70(defun socket-fd (socket)
                    
71  (etypecase socket
                    
72    (fixnum socket)
                    
73    (comm:socket-stream (comm:socket-stream-socket socket))))
                    
74
                    
80      (comm::create-tcp-socket-for-service port)
                    
81    (cond (socket socket)
                    
82          (t (error 'network-error 
                    
88(defimplementation local-port (socket)
                    
89  (nth-value 1 (comm:get-socket-address (socket-fd socket))))
                    
90
                    
91(defimplementation close-socket (socket)
                    
92  (comm::close-socket (socket-fd socket)))
                    
93
                    
                
swank-cmucl.lisp https://bitbucket.org/sakito/dot.emacs.d/ | Lisp | 0 lines
                    
93(defimplementation local-port (socket)
                    
94  (nth-value 1 (ext::get-socket-host-and-port (socket-fd socket))))
                    
95
                    
110(defimplementation socket-fd (socket)
                    
111  "Return the filedescriptor for the socket represented by SOCKET."
                    
112  (etypecase socket
                    
200(defimplementation remove-sigio-handlers (socket)
                    
201  (let ((fd (socket-fd socket)))
                    
202    (when (assoc fd *sigio-handlers*)
                    
213(defimplementation add-fd-handler (socket fn)
                    
214  (let ((fd (socket-fd socket)))
                    
215    (sys:add-fd-handler fd :input (lambda (_) _ (funcall fn)))))
                    
217(defimplementation remove-fd-handlers (socket)
                    
218  (sys:invalidate-descriptor (socket-fd socket)))
                    
219
                    
                
swank-sbcl.lisp https://bitbucket.org/sakito/dot.emacs.d/ | Lisp | 0 lines
                    
78(defimplementation create-socket (host port)
                    
79  (let ((socket (make-instance 'sb-bsd-sockets:inet-socket
                    
80			       :type :stream
                    
91  (sb-sys:invalidate-descriptor (socket-fd socket))
                    
92  (sb-bsd-sockets:socket-close socket))
                    
93
                    
160    (fixnum socket)
                    
161    (sb-bsd-sockets:socket (sb-bsd-sockets:socket-file-descriptor socket))
                    
162    (file-stream (sb-sys:fd-stream-fd socket))))
                    
275(defun make-socket-io-stream (socket external-format buffering)
                    
276  (sb-bsd-sockets:socket-make-stream socket
                    
277                                     :output t
                    
287  (loop (handler-case
                    
288            (return (sb-bsd-sockets:socket-accept socket))
                    
289          (sb-bsd-sockets:interrupted-error ()))))
                    
                
slime.el https://bitbucket.org/sakito/dot.emacs.d/ | Emacs Lisp | 0 lines
                    
30;;
                    
31;;   A socket-based communication/RPC interface between Emacs and
                    
32;;   Lisp, enabling introspection and remote development.
                    
                
swank-ecl.lisp https://bitbucket.org/sakito/dot.emacs.d/ | Lisp | 0 lines
                    
65(defimplementation create-socket (host port)
                    
66  (let ((socket (make-instance 'sb-bsd-sockets:inet-socket
                    
67			       :type :stream
                    
69    (setf (sb-bsd-sockets:sockopt-reuse-address socket) t)
                    
70    (sb-bsd-sockets:socket-bind socket (resolve-hostname host) port)
                    
71    (sb-bsd-sockets:socket-listen socket 5)
                    
77(defimplementation close-socket (socket)
                    
78  (sb-bsd-sockets:socket-close socket))
                    
79
                    
83  (declare (ignore timeout))
                    
84  (sb-bsd-sockets:socket-make-stream (accept socket)
                    
85                                     :output t
                    
98    (two-way-stream (socket-fd (two-way-stream-input-stream socket)))
                    
99    (sb-bsd-sockets:socket (sb-bsd-sockets:socket-file-descriptor socket))
                    
100    (file-stream (si:file-stream-fd socket))))
                    
                
swank-allegro.lisp https://bitbucket.org/sakito/dot.emacs.d/ | Lisp | 0 lines
                    
35(defimplementation create-socket (host port)
                    
36  (socket:make-socket :connect :passive :local-port port 
                    
37                      :local-host host :reuse-address t))
                    
39(defimplementation local-port (socket)
                    
40  (socket:local-port socket))
                    
41
                    
41
                    
42(defimplementation close-socket (socket)
                    
43  (close socket))
                    
44
                    
45(defimplementation accept-connection (socket &key external-format buffering
                    
46                                             timeout)
                    
47  (declare (ignore buffering timeout))
                    
48  (let ((s (socket:accept-connection socket :wait t)))
                    
49    (when external-format
                    
                
IoFile.c git://github.com/stevedekorte/io.git | C | 1255 lines
                    
74	{"descriptor", IoFile_descriptor},
                    
75	{"descriptorId", IoFile_descriptor}, // compatible with Socket
                    
76	// standard I/O
                    
                
SimpleHttpFetcher.java git://github.com/sguo/bixo.git | Java | 865 lines
                    
69import org.apache.http.conn.params.ConnPerRouteBean;
                    
70import org.apache.http.conn.scheme.PlainSocketFactory;
                    
71import org.apache.http.conn.scheme.Scheme;
                    
73import org.apache.http.conn.ssl.AbstractVerifier;
                    
74import org.apache.http.conn.ssl.SSLSocketFactory;
                    
75import org.apache.http.cookie.params.CookieSpecParamBean;
                    
327        _httpVersion = HttpVersion.HTTP_1_1;
                    
328        _socketTimeout = DEFAULT_SOCKET_TIMEOUT;
                    
329        _connectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
                    
352
                    
353    public void setSocketTimeout(int socketTimeoutInMs) {
                    
354        if (_httpClient == null) {
                    
354        if (_httpClient == null) {
                    
355            _socketTimeout = socketTimeoutInMs;
                    
356        } else {
                    
                
SimpleHttpFetcherTest.java git://github.com/sguo/bixo.git | Java | 435 lines
                    
21import org.mortbay.http.HttpServer;
                    
22import org.mortbay.http.SocketListener;
                    
23import org.mortbay.http.handler.AbstractHttpHandler;
                    
145        HttpServer server = startServer(new ResourcesResponseHandler(), 8089);
                    
146        SocketListener sl = (SocketListener)server.getListeners()[0];
                    
147        sl.setLingerTimeSecs(-1);
                    
                
mzwin.def git://github.com/gmarceau/PLT.git | Module-Definition | 603 lines
                    
487 scheme_get_port_fd
                    
488 scheme_get_port_socket
                    
489 scheme_socket_to_ports
                    
                
racket3m.exp git://github.com/gmarceau/PLT.git | Expect | 627 lines
                    
510scheme_get_port_fd
                    
511scheme_get_port_socket
                    
512scheme_socket_to_ports
                    
                
thread.c git://github.com/gmarceau/PLT.git | C | 7989 lines
                    
55# endif
                    
56# ifdef USE_BEOS_SOCKET_INCLUDE
                    
57#  include <be/net/socket.h>
                    
65#ifdef USE_BEOS_PORT_THREADS
                    
66# include <be/net/socket.h>
                    
67#endif
                    
                
 

Source

Language