100+ results results for 'socket repo:bdrewery/bdlib' (1152 ms)
14 /* 15 * WebSocket Framing Protocol 16 *overload1.html git://github.com/MisterTea/HyperNEAT.git | HTML | 94 lines
26<div class="titlepage"><div><div><h5 class="title"> 27<a name="boost_asio.reference.basic_socket_streambuf.shutdown.overload1"></a><a class="link" href="overload1.html" title="basic_socket_streambuf::shutdown (1 of 2 overloads)">basic_socket_streambuf::shutdown 28 (1 of 2 overloads)</a> 44<a name="boost_asio.reference.basic_socket_streambuf.shutdown.overload1.h0"></a> 45 <span class="phrase"><a name="boost_asio.reference.basic_socket_streambuf.shutdown.overload1.parameters"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_socket_streambuf.shutdown.overload1.parameters">Parameters</a> 46 </h6> 57<a name="boost_asio.reference.basic_socket_streambuf.shutdown.overload1.h1"></a> 58 <span class="phrase"><a name="boost_asio.reference.basic_socket_streambuf.shutdown.overload1.exceptions"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_socket_streambuf.shutdown.overload1.exceptions">Exceptions</a> 59 </h6> 75 </p> 76<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">socket</span> <span class="identifier">socket</span><span class="special">(</span><span class="identifier">io_service</span><span class="special">);</span> 77<span class="special">...</span> 77<span class="special">...</span> 78<span class="identifier">socket</span><span class="special">.</span><span class="identifier">shutdown</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">socket</span><span class="special">::</span><span class="identifier">shutdown_send</span><span class="special">);</span> 79</pre>send.html git://github.com/MisterTea/HyperNEAT.git | HTML | 68 lines
7<link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> 8<link rel="up" href="../basic_raw_socket.html" title="basic_raw_socket"> 9<link rel="prev" href="reuse_address.html" title="basic_raw_socket::reuse_address"> 22<div class="spirit-nav"> 23<a accesskey="p" href="reuse_address.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_raw_socket.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="send/overload1.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="boost_asio.reference.basic_raw_socket.send"></a><a class="link" href="send.html" title="basic_raw_socket::send">basic_raw_socket::send</a> 28</h4></div></div></div> 36 <span class="keyword">const</span> <span class="identifier">ConstBufferSequence</span> <span class="special">&</span> <span class="identifier">buffers</span><span class="special">);</span> 37 <span class="emphasis"><em>» <a class="link" href="send/overload1.html" title="basic_raw_socket::send (1 of 3 overloads)">more...</a></em></span> 38 40 <span class="keyword">typename</span> <a class="link" href="../ConstBufferSequence.html" title="Constant buffer sequence requirements">ConstBufferSequence</a><span class="special">></span> 41<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="send/overload2.html" title="basic_raw_socket::send (2 of 3 overloads)">send</a><span class="special">(</span> 42 <span class="keyword">const</span> <span class="identifier">ConstBufferSequence</span> <span class="special">&</span> <span class="identifier">buffers</span><span class="special">,</span>dsi_tcp.c git://pkgs.fedoraproject.org/netatalk | C | 414 lines
26#include <sys/time.h> 27#include <sys/socket.h> 28 79{ 80 if (dsi->socket == -1) 81 return; 82 83 close(dsi->socket); 84 dsi->socket = -1; 94static struct itimerval itimer; 95/* accept the socket and do a little sanity checking */ 96static int dsi_tcp_open(DSI *dsi) 101 len = sizeof(dsi->client); 102 dsi->socket = accept(dsi->serversock, (struct sockaddr *) &dsi->client, &len); 103SocketsProvider.cs https://cstactics.svn.codeplex.com/svn | C# | 359 lines
21 22 private Socket socket; 23 private DnsEndPoint endPoint; 68 if (args.SocketError != SocketError.Success) 69 throw new SocketException((int)args.SocketError); 70 } 326 { 327 Socket s = e.UserToken as Socket; 328 if (s.Connected) 343 344 //throw new SocketException((int)e.SocketError); 345 } 351 Initialized = false; 352 socket.Shutdown(SocketShutdown.Both); 353 if (socket.Connected)netmsg.bas http://segin-utils.googlecode.com/svn/trunk/ | Basic | 577 lines
84' 85' Linux does NOT need socket library inits, unlike Windows... 86' 122function hOpen( byval proto as integer = IPPROTO_TCP ) as SOCKET export 123 dim s as SOCKET 124 153 154 function = bind( s, cast( PSOCKADDR, @sa ), len( sa ) ) <> SOCKET_ERROR 155 160 161 function = listen( s, timeout ) <> SOCKET_ERROR 162 165''::::: 166function hAccept( byval s as SOCKET, byval sa as sockaddr_in ptr ) as SOCKET export 167 dim salen as integerncpop3.pas https://openxp.svn.sourceforge.net/svnroot/openxp | Pascal | 479 lines
33 Netcall, { TNetcall } 34 NCSocket, { TSocketNetcall } 35 Classes, { TStringList } 38type 39 EPOP3 = class(ESocketNetcall); 40 41type 42 TPOP3 = class(TSocketNetcall) 43bluetooth_adapter_profile_bluez_unittest.cc git://github.com/chromium/chromium.git | C++ | 391 lines
163 // unowned pointer as expected to be used by clients of 164 // BluetoothAdapterBlueZ::UseProfile like BluetoothSocketBlueZ 165 BluetoothAdapterProfileBlueZ* profile_user_ptr_;kqueue.go git://github.com/garyburd/gopkgdoc.git | Go | 503 lines
187 // Don't watch sockets. 188 if fi.Mode()&os.ModeSocket == os.ModeSocket { 189 return "", nilNavigilProtocolDecoder.java https://bitbucket.org/josedaudi_/traccar.git | Java | 317 lines
27 28import java.net.SocketAddress; 29import java.nio.ByteOrder; 272 protected Object decode( 273 Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { 274WebSocketsConnectionHandlerTest.java git://github.com/WindowsAzure/azure-sdk-for-java.git | Java | 219 lines
38import static com.azure.core.amqp.implementation.handler.ConnectionHandler.PLATFORM; 39import static com.azure.core.amqp.implementation.handler.WebSocketsConnectionHandler.HTTPS_PORT; 40import static com.azure.core.amqp.implementation.handler.WebSocketsConnectionHandler.MAX_FRAME_SIZE; 45 46public class WebSocketsConnectionHandlerTest { 47 private static final ClientOptions CLIENT_OPTIONS = new ClientOptions(); 55 56 private WebSocketsConnectionHandler handler; 57 private ConnectionOptions connectionOptions; 72 CbsAuthorizationType.SHARED_ACCESS_SIGNATURE, "authorization-scope", 73 AmqpTransportType.AMQP_WEB_SOCKETS, new AmqpRetryOptions(), ProxyOptions.SYSTEM_DEFAULTS, 74 scheduler, CLIENT_OPTIONS, VERIFY_MODE, PRODUCT, CLIENT_VERSION); 189 190 try (WebSocketsConnectionHandler handler = new WebSocketsConnectionHandler(CONNECTION_ID, connectionOptions, 191 peerDetails)) {async_write_some.html git://github.com/MisterTea/HyperNEAT.git | HTML | 116 lines
7<link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> 8<link rel="up" href="../basic_stream_socket.html" title="basic_stream_socket"> 9<link rel="prev" href="async_send/overload2.html" title="basic_stream_socket::async_send (2 of 2 overloads)"> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="boost_asio.reference.basic_stream_socket.async_write_some"></a><a class="link" href="async_write_some.html" title="basic_stream_socket::async_write_some">basic_stream_socket::async_write_some</a> 28</h4></div></div></div> 45<a name="boost_asio.reference.basic_stream_socket.async_write_some.h0"></a> 46 <span class="phrase"><a name="boost_asio.reference.basic_stream_socket.async_write_some.parameters"></a></span><a class="link" href="async_write_some.html#boost_asio.reference.basic_stream_socket.async_write_some.parameters">Parameters</a> 47 </h6> 80<a name="boost_asio.reference.basic_stream_socket.async_write_some.h1"></a> 81 <span class="phrase"><a name="boost_asio.reference.basic_stream_socket.async_write_some.remarks"></a></span><a class="link" href="async_write_some.html#boost_asio.reference.basic_stream_socket.async_write_some.remarks">Remarks</a> 82 </h6> 89<a name="boost_asio.reference.basic_stream_socket.async_write_some.h2"></a> 90 <span class="phrase"><a name="boost_asio.reference.basic_stream_socket.async_write_some.example"></a></span><a class="link" href="async_write_some.html#boost_asio.reference.basic_stream_socket.async_write_some.example">Example</a> 91 </h6>overload1.html git://github.com/MisterTea/HyperNEAT.git | HTML | 116 lines
26<div class="titlepage"><div><div><h5 class="title"> 27<a name="boost_asio.reference.basic_raw_socket.async_receive.overload1"></a><a class="link" href="overload1.html" title="basic_raw_socket::async_receive (1 of 2 overloads)">basic_raw_socket::async_receive 28 (1 of 2 overloads)</a> 30<p> 31 Start an asynchronous receive on a connected socket. 32 </p> 45<a name="boost_asio.reference.basic_raw_socket.async_receive.overload1.h0"></a> 46 <span class="phrase"><a name="boost_asio.reference.basic_raw_socket.async_receive.overload1.parameters"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_raw_socket.async_receive.overload1.parameters">Parameters</a> 47 </h6> 80<a name="boost_asio.reference.basic_raw_socket.async_receive.overload1.h1"></a> 81 <span class="phrase"><a name="boost_asio.reference.basic_raw_socket.async_receive.overload1.remarks"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_raw_socket.async_receive.overload1.remarks">Remarks</a> 82 </h6> 89<a name="boost_asio.reference.basic_raw_socket.async_receive.overload1.h2"></a> 90 <span class="phrase"><a name="boost_asio.reference.basic_raw_socket.async_receive.overload1.example"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_raw_socket.async_receive.overload1.example">Example</a> 91 </h6>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__);stub_dev.c http://wl500g.googlecode.com/svn/trunk/ | C | 544 lines
87 int sockfd = 0; 88 struct socket *socket; 89 107 108 socket = sockfd_to_socket(sockfd); 109 if (!socket) { 112 } 113 sdev->ud.tcp_socket = socket; 114 186 if (ud->tcp_socket) { 187 dev_dbg(&sdev->udev->dev, "shutdown tcp_socket %p\n", 188 ud->tcp_socket); 188 ud->tcp_socket); 189 ud->tcp_socket->ops->shutdown(ud->tcp_socket, SEND_SHUTDOWN|RCV_SHUTDOWN); 190 }DefaultHostnameVerifier.SSLSocketFactory.html http://vt-middleware.googlecode.com/svn/ | HTML | 142 lines
7<TITLE> 8Uses of Class edu.vt.middleware.ldap.ssl.DefaultHostnameVerifier.SSLSocketFactory (VT LDAP Libraries 3.3.5 API) 9</TITLE> 16{ 17 parent.document.title="Uses of Class edu.vt.middleware.ldap.ssl.DefaultHostnameVerifier.SSLSocketFactory (VT LDAP Libraries 3.3.5 API)"; 18} 38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../edu/vt/middleware/ldap/ssl/DefaultHostnameVerifier.SSLSocketFactory.html" title="class in edu.vt.middleware.ldap.ssl"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> 40 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> 57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 58 <A HREF="../../../../../../index.html?edu/vt/middleware/ldap/ssl/class-use/DefaultHostnameVerifier.SSLSocketFactory.html" target="_top"><B>FRAMES</B></A> 59 <A HREF="DefaultHostnameVerifier.SSLSocketFactory.html" target="_top"><B>NO FRAMES</B></A> 80<H2> 81<B>Uses of Class<br>edu.vt.middleware.ldap.ssl.DefaultHostnameVerifier.SSLSocketFactory</B></H2> 82</CENTER>TLSSocketFactoryTest.java http://vt-middleware.googlecode.com/svn/ | Java | 209 lines
120 final TLSSocketFactory sf = 121 (TLSSocketFactory) ldap.getLdapConfig().getSslSocketFactory(); 122 148 AssertJUnit.assertEquals( 149 Arrays.asList(((SSLSocket) sf.createSocket()).getEnabledCipherSuites()), 150 Arrays.asList(CIPHERS)); 161 final TLSSocketFactory sf = 162 (TLSSocketFactory) ldap.getLdapConfig().getSslSocketFactory(); 163 169 AssertJUnit.assertNotSame( 170 Arrays.asList(((SSLSocket) sf.createSocket()).getEnabledProtocols()), 171 Arrays.asList(PROTOCOLS)); 203 AssertJUnit.assertEquals( 204 Arrays.asList(((SSLSocket) sf.createSocket()).getEnabledProtocols()), 205 Arrays.asList(PROTOCOLS));Makefile git://pkgs.fedoraproject.org/openvas-client | Makefile | 304 lines
7 $(RUN_LIBS) $(C_R_LIB) -lm \ 8 $(DL_LIB) -lz $(SOCKET_LIB) $(LIBOPENVAS_LIBS) 9 81 ../src/util/openvas_lsc_target_prep.o\ 82 ../src/util/openvas-socket.o 83rxecho.c git://pkgs.fedoraproject.org/ax25-tools | C | 518 lines
36 * - sockaddr_pkt is the right struct for recvfrom/sendto on 37 * type SOCK_PACKET family AF_INET sockets. 38 * - added support for new PF_PACKET family with sockaddr_ll 67 68#include <sys/socket.h> 69 72 * uncomment this if you have problems with sockaddr_pkt. 73 * sockaddr_pkt is the right way for type SOCK_PACKET on family AF_INET sockets. 74 * especially because the "sockaddr" on recvfrom is truncated (internaly 414#ifdef USE_SOCKADDR_SLL 415 if ((s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_AX25))) == -1) { 416#else 416#else 417 if ((s = socket(AF_INET, SOCK_PACKET, htons(ETH_P_AX25))) == -1) { 418#endifgnuslib.c git://pkgs.fedoraproject.org/xemacs | C | 467 lines
203 204#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) 205/* 260 connect_to_unix_server -- establish connection with server process via a unix- 261 domain socket. Returns socket descriptor for server 262 if successful. 323 connect_to_internet_server -- establish connection with server process via 324 an internet domain socket. Returns socket 325 descriptor for server if successful. 405 406#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) 407/* 465} /* disconnect_from_server */ 466#endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ 467process.c git://github.com/FooBarWidget/passenger.git | C | 525 lines
114 115int uv__make_socketpair(int fds[2], int flags) { 116#if defined(__linux__) 121 122 if (socketpair(AF_UNIX, SOCK_STREAM | UV__SOCK_CLOEXEC | flags, 0, fds) == 0) 123 return 0; 135 136 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) 137 return -errno; 202 else 203 return uv__make_socketpair(fds, 0); 204Server.vala http://libzee.googlecode.com/svn/trunk/ | Vala | 215 lines
55 */ 56 protected InetSocketAddress _address; 57 /** 57 /** 58 * Server's socket service 59 */ 59 */ 60 protected ThreadedSocketService _service; 61 90 91 this._address = new InetSocketAddress(addr, port); 92 this._max_threads = max_threads; 135 // [TODO]: Wrap the generic GLib error 136 this._service.add_address(this._address, SocketType.STREAM, SocketProtocol.TCP, null, null); 137sync_slave.cpp git://pkgs.fedoraproject.org/warmux | C++ | 253 lines
22#include <sys/types.h> 23#include <sys/socket.h> 24#include <sys/ioctl.h>io_handler_buffer_helper.cc git://pkgs.fedoraproject.org/mediatomb | C++ | 231 lines
62 signalAfterEveryRead = false; 63 checkSocket = false; 64 97 { 98 if (checkSocket) 99 { 99 { 100 checkSocket = false; 101 return CHECK_SOCKET;spacewalk-channel.py git://pkgs.fedoraproject.org/rhn-client-tools | Python | 163 lines
18import re 19import socket 20import sysConnectionSettingsTest.java git://pkgs.fedoraproject.org/qpid-cpp | Java | 175 lines
110 { 111 systemPropertyOverrideForSocketBufferSize(ClientProperties.SEND_BUFFER_SIZE_PROP_NAME, 1024, false); 112 } 116 { 117 systemPropertyOverrideForSocketBufferSize(ClientProperties.LEGACY_SEND_BUFFER_SIZE_PROP_NAME, 1024, false); 118 } 126 { 127 systemPropertyOverrideForSocketBufferSize(ClientProperties.RECEIVE_BUFFER_SIZE_PROP_NAME, 1024, true); 128 } 132 { 133 systemPropertyOverrideForSocketBufferSize(ClientProperties.LEGACY_RECEIVE_BUFFER_SIZE_PROP_NAME, 1024, true); 134 } 154 155 private void systemPropertyOverrideForSocketBufferSize(String propertyName, int value, boolean read) 156 {hydra-cisco-enable.c git://pkgs.fedoraproject.org/hydra | C | 194 lines
66 67 hydra_register_socket(sp); 68 if (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT)) == 0)RedisClient.cs git://github.com/ccollie/Guanima.Redis.git | C# | 432 lines
238 239 #region Sockets 240 240 241 internal void DisposeSocket(PooledSocket socket) 242 { 242 { 243 if (socket != null) 244 ((IDisposable)socket).Dispose();main.c git://pkgs.fedoraproject.org/net-snmp | C | 540 lines
64int Aflag; /* show addresses of protocol control block */ 65int aflag; /* show all sockets (including servers) */ 66int bflag; /* show bytes instead of packets */ 199 /* case 'l': OpenBSD: Wider IPv6 display 200 Linux: Listening sockets only 201 lflag = 1; 271 break; 272 case 'u': OpenBSD: unix sockets only 273 af = AF_UNIX;wayland-client.c git://pkgs.fedoraproject.org/wayland | C | 586 lines
30#include <unistd.h> 31#include <sys/socket.h> 32#include <sys/un.h> 303static int 304connect_to_socket(struct wl_display *display, const char *name) 305{ 310 311 display->fd = wl_os_socket_cloexec(PF_LOCAL, SOCK_STREAM, 0); 312 if (display->fd < 0) 360 memset(display, 0, sizeof *display); 361 connection = getenv("WAYLAND_SOCKET"); 362 if (connection) { 370 fcntl(display->fd, F_SETFD, flags | FD_CLOEXEC); 371 unsetenv("WAYLAND_SOCKET"); 372 } else if (connect_to_socket(display, name) < 0) {myleftchatluadb.as http://as3chat.googlecode.com/svn/trunk/ | ActionScript | 430 lines
33 { 34 private var socket:SocketConnection; 35 private var host:String = 'myleft.org'; 193 194 socket = new SocketConnection; 195 socket.addEventListener(Define.CONNECT, eventHandle); 333 { 334 if (!socket.socket.connected) { 335 progressDialog.setTitle('???...'); 405 { 406 if (socket.socket.connected) socket.send('<quit/>'); 407 } 414 } 415 else if (socket.socket.connected && messageText.getText().length>0) 416 {websocket_handshake_stream_base.h git://github.com/chromium/chromium.git | C Header | 157 lines
4 5#ifndef NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ 6#define NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ 20#include "net/http/http_stream.h" 21#include "net/websockets/websocket_deflate_parameters.h" 22#include "net/websockets/websocket_stream.h" 75 // Server responded to WebSocket request over an HTTP/2 connection with 76 // invalid sec-websocket-extensions header. 77 HTTP2_FAILED_EXTENSIONS = 14, 101 bool using_proxy, 102 WebSocketEndpointLockManager* websocket_endpoint_lock_manager) = 0; 103 156 157#endif // NET_WEBSOCKETS_WEBSOCKET_HANDSHAKE_STREAM_BASE_H_ 158mod_storage_sql1.lua git://github.com/bjc/prosody.git | Lua | 415 lines
29local json = require "util.json"; 30local build_url = require"socket.url".build; 31nonroot.html https://code.google.com/p/bugzilla4intranet/ | HTML | 745 lines
188datadir=/home/foo/mymysql 189socket=/home/foo/mymysql/thesock 190port=8081 192[mysql] 193socket=/home/foo/mymysql/thesock 194port=8081NioServer.java http://wastelanders.googlecode.com/svn/trunk/ | Java | 396 lines
90 */ 91 private Map<SocketChannel, List<ByteBuffer>> pendingData = new HashMap<SocketChannel, List<ByteBuffer>>(); 92 279 // channel. 280 ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel(); 281 282 // Accept the connection and make it non-blocking 283 SocketChannel socketChannel = serverSocketChannel.accept(); 284 socketChannel.configureBlocking(false); 293 private void read(SelectionKey key) { 294 SocketChannel socketChannel = (SocketChannel) key.channel(); 295 328 private void write(SelectionKey key) { 329 SocketChannel socketChannel = (SocketChannel) key.channel(); 330xprt.h https://github.com/mdombroski/linux-2.6.git | C Header | 407 lines
12#include <linux/uio.h> 13#include <linux/socket.h> 14#include <linux/in.h>cluster.go https://code.google.com/p/camlistore/ | Go | 482 lines
132 133 socket, err := server.AcquireSocket() 134 if err != nil { 134 if err != nil { 135 log("SYNC Failed to get socket to ", addr, ": ", err.Error()) 136 return 138 139 // Monotonic will let us talk to a slave and still hold the socket. 140 session := newSession(Monotonic, cluster, socket, 10 * time.Second) 412 413// AcquireSocket returns a socket to a server in the cluster. If slaveOk is 414// true, it will attempt to return a socket to a slave server. If it is 415// false, the socket will necessarily be to a master server. 416func (cluster *mongoCluster) AcquireSocket(slaveOk bool, syncTimeout time.Duration) (s *mongoSocket, err error) { 417 started := time.Now()ThriftSyncConnectionFactoryImpl.java git://github.com/Netflix/astyanax.git | Java | 293 lines
45import org.apache.thrift.transport.TFramedTransport; 46import org.apache.thrift.transport.TSocket; 47import org.apache.thrift.transport.TTransportException; 84 private TFramedTransport transport; 85 private TSocket socket; 86 private int timeout = 0; 96 long latency = 0; 97 setTimeout(cpConfig.getSocketTimeout()); // In case the 98 // configuration 155 try { 156 socket = new TSocket(getHost().getIpAddress(), getHost().getPort(), cpConfig.getConnectTimeout()); 157 socket.getSocket().setTcpNoDelay(true); 158 socket.getSocket().setKeepAlive(true); 159 socket.getSocket().setSoLinger(false, 0); 160octwin.inc https://openxp.svn.sourceforge.net/svnroot/openxp | Pascal | 218 lines
59function TTelnetObj.Connect(Dest: String): Boolean; 60const isocket: TInetSockAddr= (Family:AF_INET;Port:$274E;Addr:$0100A8C0); 61begin 62 Connect:=False; 63 SHandle:=Socket(AF_INET,SOCK_STREAM,0); 64 if SocketError<>0 then begin ErrorStr:='Error opening socket'; exit end; 64 if SocketError<>0 then begin ErrorStr:='Error opening socket'; exit end; 65 if not Sockets.Connect(SHandle,isocket,SIn,SOut)then begin ErrorStr:='Error connecting socket'; exit end; 66 ReWrite(sout); Reset(sin); SOpened:=True; Connect:=True;Makefile.in git://pkgs.fedoraproject.org/kbilliards | Autoconf | 447 lines
124LIBSM = @LIBSM@ 125LIBSOCKET = @LIBSOCKET@ 126LIBTOOL = @LIBTOOL@xpc_partition.c git://github.com/torvalds/linux.git | C | 534 lines
146 } 147 rp = (struct xpc_rsvd_page *)__va(xp_socket_pa(rp_pa)); 148network-threadedfortuneserver.html git://pkgs.fedoraproject.org/mingw-qt | HTML | 150 lines
86 <span class="keyword">signals</span>: 87 <span class="type">void</span> error(<span class="type"><a href="qtcpsocket.html">QTcpSocket</a></span><span class="operator">::</span>SocketError socketError); 88 94<pre class="cpp"> FortuneThread<span class="operator">::</span>FortuneThread(<span class="type">int</span> socketDescriptor<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&</span>fortune<span class="operator">,</span> <span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>parent) 95 : <span class="type"><a href="qthread.html">QThread</a></span>(parent)<span class="operator">,</span> socketDescriptor(socketDescriptor)<span class="operator">,</span> text(fortune) 96 { 101 <span class="type"><a href="qtcpsocket.html">QTcpSocket</a></span> tcpSocket;</pre> 102<p>The first thing our run() function does is to create a <a href="qtcpsocket.html">QTcpSocket</a> object on the stack. What's worth noticing is that we are creating this object inside the thread, which automatically associates the socket to the thread's event loop. This ensures that Qt will not try to deliver events to our socket from the main thread while we are accessing it from FortuneThread::run().</p> 103<pre class="cpp"> <span class="keyword">if</span> (<span class="operator">!</span>tcpSocket<span class="operator">.</span>setSocketDescriptor(socketDescriptor)) { 106 }</pre> 107<p>The socket is initialized by calling <a href="qabstractsocket.html#setSocketDescriptor">QTcpSocket::setSocketDescriptor</a>(), passing our socket descriptor as an argument. We expect this to succeed, but just to be sure, (although unlikely, the system may run out of resources,) we catch the return value and report any error.</p> 108<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> block; 119 }</pre> 120<p>But unlike the previous example, we finish off by calling <a href="qabstractsocket.html#waitForDisconnected">QTcpSocket::waitForDisconnected</a>(), which blocks the calling thread until the socket has disconnected. Because we are running in a separate thread, the GUI will remain responsive.</p> 121</div>topology_map.py git://pkgs.fedoraproject.org/mysql-utilities | Python | 340 lines
63 self.num_retries = options.get("num_retries", 0) 64 self.socket_path = options.get("socket_path", None) 65 self.seed_server = seed_server 94 95 # Clear socket if used with a local server 96 if (conn['host'] == 'localhost' or \ 97 conn['host'] == "127.0.0.1"): 98 conn['unix_socket'] = None 99id.po.in git://git.savannah.gnu.org/gsasl.git | Autoconf | 249 lines
50#, c-format 51msgid "Cannot initialize Windows sockets." 52msgstr "Tidak dapat menginisialisasi soket Windows."SynchConnection.java https://github.com/parag/jredis.git | Java | 178 lines
81 * <p> 82 * This constructor will open the socket connection immediately. 83 * 86 * @throws ClientRuntimeException due to either dns (host connectivity) or any IO issues related to establishing 87 * the socket connection to the specified server. 88 * @throws ProviderException if the version specified is not supported.tcp.c http://wl500g.googlecode.com/svn/trunk/ | C | 312 lines
51*/ 52RC_TYPE tcp_destruct(TCP_SOCKET *p_self) 53{ 107 { 108 p_self->super.socket = socket(AF_INET, SOCK_STREAM, 0); 109 if (p_self->super.socket == -1) 110 { 111 int code = os_get_socket_error(); 112 128 logit(LOG_WARNING, MODULE_TAG "Failed binding client socket to local address: %s", strerror(code)); 129 rc = RC_IP_SOCKET_BIND_ERROR; 130 break; 143 setsockopt(p_self->super.socket, SOL_SOCKET, SO_RCVTIMEO, &sv, svlen); 144 setsockopt(p_self->super.socket, SOL_SOCKET, SO_SNDTIMEO, &sv, svlen); 145OutputBufferProcessor.java git://github.com/Graylog2/graylog2-server.git | Java | 155 lines
1/** 2 * Copyright 2012 Lennart Koopmann <lennart@socketfeed.com> 3 * 51/** 52 * @author Lennart Koopmann <lennart@socketfeed.com> 53 */test_term_endpoint.cpp git://github.com/zeromq/libzmq.git | C++ | 183 lines
35/* Use the worst case filename size for the buffer (+1 for trailing NUL), this 36 * is larger than MAX_SOCKET_STRING, which is not large enough for IPC */ 37#define BUF_SIZE (FILENAME_MAX + 1) 51 // Create infrastructure. 52 void *push = test_context_socket (ZMQ_PUSH); 53 bind_loopback_ipv4 (push, my_endpoint, BUF_SIZE); 54 55 void *pull = test_context_socket (ZMQ_PULL); 56 TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (pull, my_endpoint)); 71 // Clean up 72 test_context_socket_close (pull); 73 test_context_socket_close (push); 78 // Create infrastructure 79 void *pull = test_context_socket (ZMQ_PULL); 80 char my_endpoint[BUF_SIZE];main.cpp https://bitbucket.org/AIBMI/trodes.git | C++ | 228 lines
40 41SocketInfo server_message[MAX_CONNECTIONS]; // the structure for the server messaging 42SocketInfo client_message[MAX_CONNECTIONS]; // the structure for the client messaging 42SocketInfo client_message[MAX_CONNECTIONS]; // the structure for the client messaging 43SocketInfo server_data[MAX_CONNECTIONS]; // the structure for receiving data 44SocketInfo client_data[MAX_CONNECTIONS]; // the structure for sendin data (currently unused) 206 sleep(1); 207 CloseSockets(server_message); 208 CloseSockets(client_message); 208 CloseSockets(client_message); 209 CloseSockets(server_data); 210 fclose(STATUSFILE);openvswitch.m4 git://pkgs.fedoraproject.org/openvswitch | m4 | 357 lines
53 [HAVE_NETLINK=no], 54 [#include <sys/socket.h> 55 #include <linux/types.h> 98 99dnl Checks for libraries needed by lib/socket-util.c. 100AC_DEFUN([OVS_CHECK_SOCKET_LIBS], 100AC_DEFUN([OVS_CHECK_SOCKET_LIBS], 101 [AC_CHECK_LIB([socket], [connect]) 102 AC_SEARCH_LIBS([gethostbyname], [resolv], [RESOLVER_LIBS=-lresolv])])net.c git://pkgs.fedoraproject.org/xconvers | C | 459 lines
73 connecttimeout = TRUE; 74 close(sockethandle); 75 251 252 res = getsockopt(sockethandle, SOL_SOCKET, SO_ERROR, &option, &size); 253 330 331 if ((sockethandle = socket (AF_INET, SOCK_STREAM, 0)) == -1) 332 { 339 /* send keepalive probes */ 340 setsockopt(sockethandle, SOL_SOCKET, SO_KEEPALIVE, (gchar *)&opt, sizeof(opt)); 341 /* make connection setup non-blocking */ 366 /* connection is non-blocking, so we set up a monitor to see if connection is succesful */ 367 connectmonitor = gdk_input_add(sockethandle, GDK_INPUT_WRITE, GTK_SIGNAL_FUNC(socket_connected), NULL); 368}alsaio.cpp git://pkgs.fedoraproject.org/kdenetwork | C++ | 558 lines
21#include <QObject> 22#include <QSocketNotifier> 23#include <QStringList> 296 { 297 close(notifier->socket()); 298 delete notifier; 365 //Always use the first pollfd 366 notifier = new QSocketNotifier(ufds[0].fd, QSocketNotifier::Read, this); 367 notifier->setEnabled(true); 374 //Always use the first pollfd 375 QSocketNotifier::Type type; 376 switch (ufds[0].events & (POLLIN | POLLPRI | POLLOUT)) 378 case POLLIN: 379 kDebug() << "QSocketNotifier::Read"; 380 type = QSocketNotifier::Read;starttls.c git://pkgs.fedoraproject.org/cone | C | 803 lines
49#endif 50#include <sys/socket.h> 51#include <arpa/inet.h> 439 440 if ((fd=rfc1035_mksocket(SOCK_STREAM, 0, &af)) < 0) 441 { 441 { 442 nonsslerror("socket"); 443 return (-1);enable_connection_aborted.html git://github.com/barrbrain/asio.git | HTML | 82 lines
7<link rel="start" href="../../../index.html" title="Asio"> 8<link rel="up" href="../basic_socket.html" title="basic_socket"> 9<link rel="prev" href="do_not_route.html" title="basic_socket::do_not_route"> 15<div class="spirit-nav"> 16<a accesskey="p" href="do_not_route.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../basic_socket.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="endpoint_type.html"><img src="../../../next.png" alt="Next"></a> 17</div> 19<div class="titlepage"><div><div><h4 class="title"> 20<a name="asio.reference.basic_socket.enable_connection_aborted"></a><a class="link" href="enable_connection_aborted.html" title="basic_socket::enable_connection_aborted">basic_socket::enable_connection_aborted</a> 21</h4></div></div></div> 32<p> 33 Implements a custom socket option that determines whether or not an accept 34 operation is permitted to fail with <code class="computeroutput"><span class="identifier">asio</span><span class="special">::</span><span class="identifier">error</span><span class="special">::</span><span class="identifier">connection_aborted</span></code>. 36 </p> 37<a name="asio.reference.basic_socket.enable_connection_aborted.examples"></a><h6> 38<a name="id913415"></a>lossydatareceiver.cc git://github.com/somaproject/libsomanetwork.git | C++ | 279 lines
26 27 socket_ = socket(AF_INET, SOCK_DGRAM, 17); 28 if (socket_ < 0) { 41 42 // confiugre socket for reuse 43 optval = 1; 43 optval = 1; 44 int res = setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, 45 &optval, sizeof (optval)); 50 optval = 1; 51 res = setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, 52 &optval, sizeof (optval)); 57 optval = 500000; 58 res = setsockopt (socket_, SOL_SOCKET, SO_RCVBUF, 59 (const void *) &optval, sizeof(optval));mod_scgi.cpp git://github.com/stefanocasazza/ULib.git | C++ | 235 lines
15#include <ulib/utility/uhttp.h> 16#include <ulib/net/tcpsocket.h> 17#include <ulib/utility/services.h> 51 // 52 // NAME_SOCKET file name for the scgi socket 53 // 88 89 U_NEW(UTCPSocket, connection->socket, UTCPSocket(connection->bIPv6)); 90# else 90# else 91 if (connection->port) U_NEW(UTCPSocket, connection->socket, UTCPSocket(connection->bIPv6)) 92 else U_NEW(UUnixSocket, connection->socket, UUnixSocket) 188 * more data is going to be send. More importantly, it doesn't close the 189 * socket. At the socket layer, this sends a TCP/IP FIN packet to the receiver 190 */epgacqsrv.h git://pkgs.fedoraproject.org/nxtvepg | C Header | 197 lines
191sint EpgAcqServer_GetFdSet( fd_set * rd, fd_set * wr ); 192void EpgAcqServer_HandleSockets( fd_set * rd, fd_set * wr ); 193void EpgAcqServer_AddBlock( EPGDB_CONTEXT * dbc, EPGDB_BLOCK * pNewBlock );device_util.mm https://github.com/chromium/chromium.git | Objective C++ | 183 lines
12#include <string.h> 13#include <sys/socket.h> 14#include <sys/sysctl.h>HTUtils.h git://github.com/alandipert/ncsa-mosaic.git | C Header | 268 lines
210#define HT_REDIRECTING 29998 211#define HT_LOADED 29999 /* Instead of a socket */ 212#define HT_INTERRUPTED -29998HTTPURLLoader.as http://crossxhr.googlecode.com/svn/trunk/ | ActionScript | 197 lines
28 29 private var socket:Socket; 30 private var headerComplete:Boolean = false; 48 49 socket = new Socket(); 50 52 socket.addEventListener( "close" , onCloseEvent , false, 0 ); 53 socket.addEventListener( "ioError" , onIOErrorEvent , false, 0 ); 54 socket.addEventListener( "securityError" , onSecurityErrorEvent , false, 0 ); 54 socket.addEventListener( "securityError" , onSecurityErrorEvent , false, 0 ); 55 socket.addEventListener( "socketData" , onSocketDataEvent , false , 0 ); 56 } 109 var str:String = ""; 110 try { str = socket.readUTFBytes(socket.bytesAvailable); } catch(e:Error) { } 111 if(!headerComplete) {CreateVDSCommand.java git://pkgs.fedoraproject.org/ovirt-engine | Java | 319 lines
100 if (Config.<Boolean> GetValue(ConfigValues.SendSMPOnRunVm)) { 101 mCreateInfo.add(VdsProperties.cores_per_socket, (new Integer(mVm.getcpu_per_socket())).toString()); 102 }config.h.in http://opensource.apple.com/release/ios-511/ | Autoconf | 464 lines
149 150/* Define to 1 if you have the `socket' library (-lsocket). */ 151#undef HAVE_LIBSOCKET 225/* */ 226#undef HAVE_SOCKETPAIR 227 295 296/* Define to 1 if you have the <sys/socket.h> header file. */ 297#undef HAVE_SYS_SOCKET_H 393 394/* Define if sockets need to be shutdown */ 395#undef SHUTDOWN_ALL_SOCKETSHistory_rdoc.html https://github.com/toy/rb.git | HTML | 532 lines
80<ul> 81<li>Reworked socket timeout code due to several customer complaints about 82timeouts not working 100% of the time since 1.7.3. 136<ul> 137<li>Rollback socket timeout optimization. It does not work on all operating 138systems and was a support headache. 146<ul> 147<li>Rely on higher performance operating system socket timeouts for low-level 148socket read/writes where possible, instead of the (slower) SystemTimer or 280<ul> 281<li>Add option to disable socket timeout support. Socket timeout has a 282significant performance penalty (approx 3x slower than without in Ruby 314</li> 315<li>Implement socket timeouts, should fix rare cases of very bad things 316happening in production at 37signals and FiveRuns. (jseirles)eX_setup.h git://git.savannah.nongnu.org/exosip.git | C Header | 377 lines
121#define EXOSIP_OPT_DNS_CAPABILITIES (EXOSIP_OPT_BASE_OPTION+14) /**< int *: 0 to disable, 2 to use NAPTR/SRV record */ 122#define EXOSIP_OPT_SET_DSCP (EXOSIP_OPT_BASE_OPTION+15) /**< int *: set a dscp value for SIP socket */ 123#define EXOSIP_OPT_REGISTER_WITH_DATE (EXOSIP_OPT_BASE_OPTION+16) /**< int *: enable usage of Date header in REGISTER */ 238/** 239 * Listen on a specified socket. 240 * 250/** 251 * Reset transport sockets. 252 * 262 * @param transport IPPROTO_UDP for udp. (soon to come: TCP/TLS?) 263 * @param socket socket to use for listening to UDP sip messages. 264 * @param port the listening port for masquerading. 265 */ 266 int eXosip_set_socket (struct eXosip_t *excontext, int transport, int socket, int port); 267overview-summary.html http://j-sim.googlecode.com/svn/trunk/ | HTML | 318 lines
191<TR BGCOLOR="white" CLASS="TableRowColor"> 192<TD WIDTH="20%"><B><A HREF="drcl/inet/socket/package-summary.html">drcl.inet.socket</A></B></TD> 193<TD> </TD>Program.cs https://code.google.com/p/prjtest00/ | C# | 352 lines
56 //console. 57 Socket NewSocket = listener.EndAcceptSocket(Result); 58 74 { 75 Socket ClientSocket = (Socket)Result.AsyncState; 76 try 84 Console.WriteLine("[{0}][Receive Message]: {1}", (int)ClientSocket.Handle, Encoding.ASCII.GetString(_RecvBuff, 0, RecvSize)); 85 ClientSocket.BeginReceive(_RecvBuff, 0, _RecvBuff.Length, SocketFlags.None, new AsyncCallback(DoReceiveCallback), ClientSocket); 86 } 192 // { 193 // Socket NewSocket = Listener.AcceptSocket(); 194 // if (NewSocket.Connected) 256 //AcceptThread.Start(Listener); 257// Socket mySocket = myTcpListener.AcceptSocket(); 258 //doIrServerApplet.lua http://irserversb.googlecode.com/svn/trunk/ | Lua | 523 lines
67 68local socket = require("socket") 69local os = require("os") 291 -- load namespace 292 -- create a TCP socket and bind it to the local host, at any port 293 server = socket.bind("*", 8174)openssl_stream_service.hpp http://openqwaq.googlecode.com/svn/trunk/ | C++ Header | 532 lines
164 165 // Construct a new stream socket service for the specified io_service. 166 explicit openssl_stream_service(asio::io_service& io_service)SocketReactor.h http://mingw-lib.googlecode.com/svn/trunk/ | C++ Header | 239 lines
88 /// Once started, the SocketReactor waits for events 89 /// on the registered sockets, using Socket::select(). 90 /// If an event is detected, the corresponding event handler 106 /// 107 /// If there are no sockets for the SocketReactor to pass to 108 /// Socket::select(), an IdleNotification will be dispatched to 164 165 void addEventHandler(const Socket& socket, const Poco::AbstractObserver& observer); 166 /// Registers an event handler with the SocketReactor. 171 172 void removeEventHandler(const Socket& socket, const Poco::AbstractObserver& observer); 173 /// Unregisters an event handler with the SocketReactor. 200 201 void dispatch(const Socket& socket, SocketNotification* pNotification); 202 /// Dispatches the given notification to all observersmdns-ffi.lisp http://cl-dns-sd.googlecode.com/svn/trunk/ | Lisp | 194 lines
75 76;; A wrapper around DNSServiceRefSockFD that raises a SOCKET-FD-ERROR 77;; if the returned value is -1. It seems that if the mDNS daemon 83 (if (eql sock -1) 84 (error 'socket-fd-error :oid ref) 85 sock)))TcpSocket.h https://bitbucket.org/CatrinaEmu/core/ | C++ Header | 357 lines
29*/ 30#ifndef _SOCKETS_TcpSocket_H 31#define _SOCKETS_TcpSocket_H 51 \ingroup basic */ 52class TcpSocket : public StreamSocket 53{ 266protected: 267 TcpSocket(const TcpSocket& ); 268 void OnRead(); 300private: 301 TcpSocket& operator=(const TcpSocket& ) { return *this; } 302 353 354#endif // _SOCKETS_TcpSocket_H 355Address.java http://dataturbine.googlecode.com/svn/trunk/ | Java | 559 lines
39 * <p> 40 * The <code>TCP</code> class provides the low-level TCP socket handling 41 * methods for using TCP server sockets as the address of an RBNB DataTurbine 49 * handling of the memory-to-memory copies. It is the RAM equivalent of a 50 * standard TCP socket. 51 * <p> 53 * side handling of the memory-to-memory copies. It is the RAM equivalent of a 54 * TCP server socket. 55 * <p> 384 } else if (type.equalsIgnoreCase("TCP:")) { 385 // TCP addresses use the TCP class for TCP socket to server 386 // socket communications.w.c https://bitbucket.org/freebsd/freebsd-head | C | 529 lines
56#include <sys/ioctl.h> 57#include <sys/socket.h> 58#include <sys/tty.h>silcexample-SilcExampleType.html git://pkgs.fedoraproject.org/libsilc | HTML | 223 lines
115 <a href=silcstream.html><img src=box2.gif border=0 alt=>Abstract Stream Interface</a><br /> 116 <a href=silcsocketstream.html><img src=box2.gif border=0 alt=>Socket Stream Interface</a><br /> 117 <a href=silcfdstream.html><img src=box2.gif border=0 alt=>File Descriptor Stream Interface</a><br />TestPackage.java git://github.com/JetBrains/intellij-community.git | Java | 287 lines
64 final TestClassFilter classFilter = computeFilter(data); 65 return new SearchForTestsTask(getConfiguration().getProject(), myServerSocket) { 66 private final Set<Location<?>> myClasses = new LinkedHashSet<>(); 204 205 createServerSocket(javaParameters); 206 return javaParameters;convert_gio.m4 git://pkgs.fedoraproject.org/glibmm24 | m4 | 271 lines
229_CONVERSION(`GSocketAddress*',`Glib::RefPtr<SocketAddress>',`Glib::wrap($3)') 230_CONVERSION(`const Glib::RefPtr<SocketAddress>&',`GSocketAddress*',__CONVERT_CONST_REFPTR_TO_P) 231_CONVERSION(`Glib::RefPtr<SocketAddress>&',`GSocketAddress*',__CONVERT_CONST_REFPTR_TO_P) 231_CONVERSION(`Glib::RefPtr<SocketAddress>&',`GSocketAddress*',__CONVERT_CONST_REFPTR_TO_P) 232_CONVERSION(`GSocketAddressEnumerator*',`Glib::RefPtr<SocketAddressEnumerator>',`Glib::wrap($3)') 233 234#SocketConnectable 235_CONVERSION(`const Glib::RefPtr<SocketConnectable>&',`GSocketConnectable*',__CONVERT_CONST_REFPTR_TO_P) 236 238_CONVERSION(`GSocketConnection*',`Glib::RefPtr<SocketConnection>',`Glib::wrap($3)') 239_CONVERSION(`const Glib::RefPtr<SocketConnection>&',`GSocketConnection*',__CONVERT_CONST_REFPTR_TO_P) 240 241#SocketControlMessage 242_CONVERSION(`GSocketControlMessage*',`Glib::RefPtr<SocketControlMessage>',`Glib::wrap($3)') 243openssl_operation.hpp http://openqwaq.googlecode.com/svn/trunk/ | C++ Header | 517 lines
28#include "asio/write.hpp" 29#include "asio/detail/socket_ops.hpp" 30#include "asio/ssl/detail/openssl_types.hpp" 86 openssl_operation(ssl_primitive_func primitive, 87 Stream& socket, 88 net_buffer& recv_buf, 97 , recv_buf_(recv_buf) 98 , socket_(socket) 99 , ssl_bio_(ssl_bio) 117 openssl_operation(ssl_primitive_func primitive, 118 Stream& socket, 119 net_buffer& recv_buf, 124 , recv_buf_(recv_buf) 125 , socket_(socket) 126 , ssl_bio_(ssl_bio)UpdateRouteResponseResult.java https://github.com/aws/aws-sdk-java.git | Java | 389 lines
22 * <p> 23 * Represents the model selection expression of a route response. Supported only for WebSocket APIs. 24 * </p> 53 * <p> 54 * Represents the model selection expression of a route response. Supported only for WebSocket APIs. 55 * </p> 57 * @param modelSelectionExpression 58 * Represents the model selection expression of a route response. Supported only for WebSocket APIs. 59 */ 66 * <p> 67 * Represents the model selection expression of a route response. Supported only for WebSocket APIs. 68 * </p> 69 * 70 * @return Represents the model selection expression of a route response. Supported only for WebSocket APIs. 71 */persistent.py git://github.com/mrjoes/tornadio2.git | Python | 193 lines
29from tornado import stack_context 30from tornado.websocket import WebSocketHandler 31 37 38class TornadioWebSocketHandler(WebSocketHandler): 39 """Websocket protocol handler""" 65 66 # Upgrade header should be present and should be equal to WebSocket 67 if self.request.headers.get("Upgrade", "").lower() != 'websocket': 69 "HTTP/1.1 400 Bad Request\r\n\r\n" 70 "Can \"Upgrade\" only to \"WebSocket\"." 71 )) 190 191class TornadioFlashSocketHandler(TornadioWebSocketHandler): 192 # Transport nameTestPing.java git://pkgs.fedoraproject.org/mod_cluster | Java | 184 lines
30import java.io.IOException; 31import java.net.ServerSocket; 32 138 try { 139 ServerSocket sock = new ServerSocket(8012); 140 } catch (Exception ex) { 140 } catch (Exception ex) { 141 fail("can't create ServerSocket on 8012"); 142 }route-linux.c git://pkgs.fedoraproject.org/nmap | C | 284 lines
12#include <sys/ioctl.h> 13#include <sys/socket.h> 14#include <sys/uio.h> 53 54 if ((r->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) 55 return (route_close(r)); 56 57 if ((r->nlfd = socket(AF_NETLINK, SOCK_RAW, 58 NETLINK_ROUTE)) < 0)linc-private.h git://pkgs.fedoraproject.org/ORBit2 | C Header | 221 lines
107 LinkWatch *link_watch; 108 SOCKET socket; 109 int event_mask; 151 */ 152#define LINK_TEMP_FAILURE_RETRY_SOCKET(expression, val) \ 153 { int __result; \ 154 do __result = (int) (expression); \ 155 while (__result == SOCKET_ERROR && WSAGetLastError() == WSAEINTR); \ 156 val = __result; } 157 158#define LINK_CLOSE_SOCKET(fd) while (closesocket (fd) == SOCKET_ERROR && WSAGetLastError() == WSAEINTR) 159 161 162/* On Unix socket API calls are no different from normal system calls */ 163coulomb.c git://pkgs.fedoraproject.org/apbs | C | 176 lines
77 if (sock == VNULL) { 78 Vnm_print(2, "Problem opening virtual socket %s!\n", 79 path); 82 if (Vio_accept(sock, 0) < 0) { 83 Vnm_print(2, "Problem accepting virtual socket %s!\n", 84 path);unix-fd.c git://pkgs.fedoraproject.org/glib2 | C | 241 lines
47 GUnixFDList *list, *l2; 48 GSocket *sockets[2]; 49 GSocketAddress *addr; 152 g_assert_no_error (err); 153 g_assert (G_IS_SOCKET (sockets[1])); 154 157 g_assert (G_IS_UNIX_SOCKET_ADDRESS (addr)); 158 g_assert_cmpint (g_unix_socket_address_get_address_type (G_UNIX_SOCKET_ADDRESS (addr)), ==, G_UNIX_SOCKET_ADDRESS_ANONYMOUS); 159 g_assert_cmpint (g_unix_socket_address_get_path_len (G_UNIX_SOCKET_ADDRESS (addr)), ==, 0); 178 ov.size = 1; 179 s = g_socket_send_message (sockets[0], NULL, &ov, 1, 180 (GSocketControlMessage **) &message, 190 iv.size = 1; 191 s = g_socket_receive_message (sockets[1], NULL, &iv, 1, 192 (GSocketControlMessage ***) &mv,MSKeyManagerImpl.java http://umjammer.googlecode.com/svn/trunk/ | Java | 373 lines
13import java.math.BigInteger; 14import java.net.Socket; 15import java.security.GeneralSecurityException; 58 /** 59 * Choose an alias to authenticate the client side of a secure socket given 60 * the public key type and the list of certificate issuer authorities 62 */ 63 public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) { 64 String alias = null; 89 /** 90 * Choose an alias to authenticate the server side of a secure socket given 91 * the public key type and the list of certificate issuer authorities 93 */ 94 public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { 95 String alias = null;Relation.scala git://github.com/ornicar/lila.git | Scala | 193 lines
162 ) 163 .add("online" -> env.socket.isOnline(r.user.id)) 164 }))MongoUrlTests.cs git://github.com/mongodb/mongo-csharp-driver.git | C# | 142 lines
58 ServerSelectionTimeout = TimeSpan.FromSeconds(10), 59 SocketTimeout = TimeSpan.FromSeconds(7), 60 Username = "username", 89 "serverSelectionTimeout=10s", 90 "socketTimeout=7s", 91 "waitQueueSize=123", 118 Assert.AreEqual(TimeSpan.FromSeconds(10), url.ServerSelectionTimeout); 119 Assert.AreEqual(TimeSpan.FromSeconds(7), url.SocketTimeout); 120 Assert.AreEqual("username", url.Username);MemoryFileSystem.js git://github.com/DarthFubuMVC/fubumvc.git | JavaScript | 226 lines
57 isFIFO: falseFn, 58 isSocket: falseFn 59 }; 67 isFIFO: falseFn, 68 isSocket: falseFn 69 };JMembaseTest.java git://github.com/couchbase/CouchbaseMock.git | Java | 391 lines
82 private boolean serverNotReady(int port) { 83 Socket socket = null; 84 try { 84 try { 85 socket = new Socket("localhost", port); 86 return false; 168 169 Socket s = new Socket("localhost", port); 170 OutputStream out = s.getOutputStream(); 229 public void testHarakiriMonitor() throws IOException { 230 ServerSocket server = new ServerSocket(0); 231 HarakiriMonitor m; 325 public void testIllegalMockCommand() throws IOException { 326 ServerSocket server = new ServerSocket(0); 327 instance.startHarakiriMonitor("localhost:" + server.getLocalPort(), false);BaseConnectionPoolTest.java git://github.com/Netflix/astyanax.git | Java | 430 lines
190 pool.addHost( 191 new Host("127.0.0.1", TestHostType.SOCKET_TIMEOUT.ordinal()), 192 true);test_urllib2net.py https://bitbucket.org/arigo/cpython-withatomic/ | Python | 365 lines
7import os 8import socket 9import urllib.error 80 81class CloseSocketTest(unittest.TestCase): 82 84 # calling .close() on urllib2's response objects should close the 85 # underlying socket 86 url = "http://www.python.org/" 135## def test_cnri(self): 136## if socket.gethostname() == 'bitdiddle': 137## localhost = 'bitdiddle.cnri.reston.va.us' 137## localhost = 'bitdiddle.cnri.reston.va.us' 138## elif socket.gethostname() == 'bitdiddle.concentric.net': 139## localhost = 'localhost'email.parser.rst https://bitbucket.org/arigo/cpython-withatomic/ | ReStructuredText | 292 lines
27a stream which might block waiting for more input (e.g. reading an email message 28from a socket). The :class:`FeedParser` can consume and parse the message 29incrementally, and only returns the root object when you close the parser [#]_. 43as would be necessary when reading the text of an email message from a source 44that can block (e.g. a socket). The :class:`FeedParser` can of course be used 45to parse an email message fully contained in a string or a file, but the classicHttpClientService.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 {AbstractClient.java http://loon-simple.googlecode.com/svn/trunk/ | Java | 508 lines
100 sc.init(null, trustAllCerts, null); 101 javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(sc 102 .getSocketFactory()); 402 port, file, connection.getContentLength(), threads, tmp_file); 403 SocketManager sm = new SocketManager(info); 404 ExternalDownload down = new ExternalDownload(header, sm);all-index-S.html http://as3mp3streamplayer.googlecode.com/svn/trunk/ | HTML | 123 lines
41<td width="20"></td><td> 42 Dispatched when the socket throws a security error 43 </td>taskmanager.c http://garakuta-okiba.googlecode.com/svn/trunk/ | C | 242 lines
70 71void Task_Add(_funcpointer fp, void *socket0, void *socket1, int count) 72{ 83 task_item->fp = fp; 84 task_item->option.socket[0] = socket0; 85 task_item->option.socket[1] = socket1;overload1.html git://github.com/MisterTea/HyperNEAT.git | HTML | 116 lines
26<div class="titlepage"><div><div><h5 class="title"> 27<a name="boost_asio.reference.basic_stream_socket.read_some.overload1"></a><a class="link" href="overload1.html" title="basic_stream_socket::read_some (1 of 2 overloads)">basic_stream_socket::read_some 28 (1 of 2 overloads)</a> 44<a name="boost_asio.reference.basic_stream_socket.read_some.overload1.h0"></a> 45 <span class="phrase"><a name="boost_asio.reference.basic_stream_socket.read_some.overload1.parameters"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_stream_socket.read_some.overload1.parameters">Parameters</a> 46 </h6> 65<a name="boost_asio.reference.basic_stream_socket.read_some.overload1.h2"></a> 66 <span class="phrase"><a name="boost_asio.reference.basic_stream_socket.read_some.overload1.exceptions"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_stream_socket.read_some.overload1.exceptions">Exceptions</a> 67 </h6> 79<a name="boost_asio.reference.basic_stream_socket.read_some.overload1.h3"></a> 80 <span class="phrase"><a name="boost_asio.reference.basic_stream_socket.read_some.overload1.remarks"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_stream_socket.read_some.overload1.remarks">Remarks</a> 81 </h6> 89<a name="boost_asio.reference.basic_stream_socket.read_some.overload1.h4"></a> 90 <span class="phrase"><a name="boost_asio.reference.basic_stream_socket.read_some.overload1.example"></a></span><a class="link" href="overload1.html#boost_asio.reference.basic_stream_socket.read_some.overload1.example">Example</a> 91 </h6>stream_protocol.cpp git://github.com/MisterTea/HyperNEAT.git | C++ | 241 lines
83#if defined(BOOST_ASIO_WINDOWS_RUNTIME) 84 Windows::Networking::Sockets::StreamSocket^ native_socket1 = nullptr; 85#else // defined(BOOST_ASIO_WINDOWS_RUNTIME) 92 boost::asio::ip::tcp::socket tcp_socket(ios); 93 sp::socket socket6(std::move(tcp_socket)); 94#endif // defined(BOOST_ASIO_HAS_MOVE) 117#if defined(BOOST_ASIO_WINDOWS_RUNTIME) 118 Windows::Networking::Sockets::StreamSocket^ native_socket2 = nullptr; 119#else // defined(BOOST_ASIO_WINDOWS_RUNTIME) 123#if defined(BOOST_ASIO_WINDOWS_RUNTIME) 124 Windows::Networking::Sockets::StreamSocket^ native_socket3 = nullptr; 125#else // defined(BOOST_ASIO_WINDOWS_RUNTIME) 135 136 sp::socket::native_type native_socket4 = socket1.native(); 137 (void)native_socket4;libFtp.tcl http://nxscripts.googlecode.com/svn/ | TCL | 500 lines
91 # ftp(queue) - Event queue (FIFO). 92 # ftp(sock) - Socket channel. 93 # ftp(status) - Connection status (0=disconnected, 1=connecting, 2=connected). 157 158 # Asynchronous sockets in Tcl are created immediately but may not be 159 # connected yet. The writable channel event callback is executed when 159 # connected yet. The writable channel event callback is executed when 160 # the socket is connected or if the connection failed. 161 set ftp(sock) [socket -async $ftp(host) $ftp(port)] 276 277 # Send the QUIT command and terminate the socket. 278 catch {puts $ftp(sock) "QUIT"}select.c git://pkgs.fedoraproject.org/wget | C | 494 lines
84static BOOL 85IsSocketHandle (HANDLE h) 86{ 94 ev.lNetworkEvents = 0xDEADBEEF; 95 WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev); 96 return ev.lNetworkEvents != 0xDEADBEEF; 325 326 /* Classify handles. Create fd sets for sockets, poll the others. */ 327 for (i = 0; i < nfds; i++) 338 339 if (IsSocketHandle (h)) 340 { 342 343 /* See above; socket handles are mapped onto select, but we 344 need to map descriptors to handles. */cli.c git://pkgs.fedoraproject.org/openvas-client | C | 637 lines
28#include <openvas/plugutils.h> /* for addslashes */ 29#include <openvas/network.h> /* for openvas_get_socket_from_connection, 30 close_stream_connection */ 32#include <openvas/misc/plugutils.h> /* for addslashes */ 33#include <openvas/misc/network.h> /* for openvas_get_socket_from_connection, 34 close_stream_connection */ 68 struct timeval tv = {2,0}; 69 int fd = openvas_get_socket_from_connection(soc); 70 110 */ 111 if(network_gets(Context->socket, buf, sizeof(buf) - 1) < 0 || buf[0] == '\0') 112 { 112 { 113 if(!is_server_present(Context->socket)) 114 {xfce4-dict-plugin.c git://pkgs.fedoraproject.org/xfce4-dict | C | 475 lines
31#include <sys/types.h> 32#include <sys/socket.h> 33#include <sys/stat.h>Runeaugments.cs https://adaptuo.svn.codeplex.com/svn | C# | 518 lines
12 13 public class TyrRune : BaseSocketAugmentation 14 { 90 91 public class AhmRune : BaseSocketAugmentation 92 { 163 164 public class MorRune : BaseSocketAugmentation 165 { 236 237 public class MefRune : BaseSocketAugmentation 238 { 309 310 public class YlmRune : BaseSocketAugmentation 311 {DispatchIoHandler.java git://github.com/liferay/liferay-portal.git | Java | 231 lines
105 public void sessionClosed(IoSession ioSession) { 106 LdapHandlerThreadLocal.clearSocketAddress(); 107 } 119 try { 120 LdapHandlerThreadLocal.setSocketAddress( 121 ioSession.getRemoteAddress());async_accept.html git://github.com/MisterTea/HyperNEAT.git | HTML | 66 lines
7<link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> 8<link rel="up" href="../basic_socket_acceptor.html" title="basic_socket_acceptor"> 9<link rel="prev" href="assign/overload2.html" title="basic_socket_acceptor::assign (2 of 2 overloads)"> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="boost_asio.reference.basic_socket_acceptor.async_accept"></a><a class="link" href="async_accept.html" title="basic_socket_acceptor::async_accept">basic_socket_acceptor::async_accept</a> 28</h4></div></div></div> 34 <span class="keyword">typename</span> <a class="link" href="../Protocol.html" title="Protocol requirements">Protocol1</a><span class="special">,</span> 35 <span class="keyword">typename</span> <a class="link" href="../SocketService.html" title="Socket service requirements">SocketService</a><span class="special">,</span> 36 <span class="keyword">typename</span> <a class="link" href="../AcceptHandler.html" title="Accept handler requirements">AcceptHandler</a><span class="special">></span> 43<span class="keyword">template</span><span class="special"><</span> 44 <span class="keyword">typename</span> <a class="link" href="../SocketService.html" title="Socket service requirements">SocketService</a><span class="special">,</span> 45 <span class="keyword">typename</span> <a class="link" href="../AcceptHandler.html" title="Accept handler requirements">AcceptHandler</a><span class="special">></span> 46<a class="link" href="../asynchronous_operations.html#boost_asio.reference.asynchronous_operations.return_type_of_an_initiating_function"><span class="emphasis"><em>void-or-deduced</em></span></a> <a class="link" href="async_accept/overload2.html" title="basic_socket_acceptor::async_accept (2 of 2 overloads)">async_accept</a><span class="special">(</span> 47 <span class="identifier">basic_socket</span><span class="special"><</span> <span class="identifier">protocol_type</span><span class="special">,</span> <span class="identifier">SocketService</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">peer</span><span class="special">,</span> 48 <span class="identifier">endpoint_type</span> <span class="special">&</span> <span class="identifier">peer_endpoint</span><span class="special">,</span>GraphiteReporter.java git://github.com/springside/springside4.git | Java | 219 lines
11import java.io.Writer; 12import java.net.InetSocketAddress; 13import java.net.Socket; 48 private InetSocketAddress address; 49 private SocketFactory socketFactory; 50 private Socket socket; 55 56 public GraphiteReporter(InetSocketAddress address) { 57 this(address, DEFAULT_PREFIX); 62 this.address = address; 63 this.socketFactory = SocketFactory.getDefault(); 64 } 137 138 this.socket = socketFactory.createSocket(address.getAddress(), address.getPort()); 139 this.writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), UTF_8));name_table.h git://github.com/torvalds/linux.git | C Header | 152 lines
57 * @scope: scope of publication, TIPC_NODE_SCOPE or TIPC_CLUSTER_SCOPE 58 * @node: network address of publishing socket's node 59 * @port: publishing port 67 * @binding_sock: all publications from the same socket which bound this one 68 * Used by socket to withdraw publications when socket is unbound/released 69 * @local_publ: list of identical publications made from this nodefd_unix.go git://github.com/axw/llgo.git | Go | 506 lines
85 case syscall.EINVAL: 86 // On Solaris we can see EINVAL if the socket has 87 // already been accepted and closed by the server. 88 // Treat this as a successful connection--writes to 89 // the socket will see EOF. For details and a test 90 // case in C see https://golang.org/issue/6828. 106 // Performing multiple connect system calls on a 107 // non-blocking socket under Unix variants does not 108 // necessarily result in earlier errors being 109 // returned. Instead, once runtime-integrated network 110 // poller tells us that the socket is ready, get the 111 // SO_ERROR socket option to see if the connection 116 } 117 nerr, err := getsockoptIntFunc(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_ERROR) 118 if err != nil {TransportLayerManager.cs https://NSsh.svn.codeplex.com/svn | C# | 411 lines
21using System.Net; 22using System.Net.Sockets; 23using System.Text; 106 107 _clientEndPoint = ClientSocket.RemoteEndPoint; 108 122 123 _clientEndPoint = ClientSocket.RemoteEndPoint; 124 174 { 175 ClientSocket.Shutdown(SocketShutdown.Both); 176 ClientSocket.Close(); 307 308 public Socket ClientSocket { get; set; } 309IOSession.java https://github.com/apache/httpcore.git | Java | 241 lines
29 30import java.net.SocketAddress; 31import java.nio.channels.ByteChannel; 34import org.apache.hc.core5.annotation.Internal; 35import org.apache.hc.core5.http.SocketModalCloseable; 36import org.apache.hc.core5.util.Identifiable; 55@Internal 56public interface IOSession extends ByteChannel, SocketModalCloseable, Identifiable { 57 122 * 123 * @return socket address. 124 */ 124 */ 125 SocketAddress getRemoteAddress(); 126server.rb git://github.com/maca/scruby.git | Ruby | 285 lines
193 194 def socket 195 osc_client.instance_variable_get(:@socket)CipherTest.java git://github.com/gaffo/scumd.git | Java | 185 lines
22import java.io.OutputStream; 23import java.net.ServerSocket; 24import java.util.Arrays; 116 protected void setUp(NamedFactory<org.apache.sshd.common.Cipher> cipher) throws Exception { 117 ServerSocket s = new ServerSocket(0); 118 port = s.getLocalPort();beos.c git://github.com/zpao/spidernode.git | C | 264 lines
44#include <sys/types.h> 45#include <sys/socket.h> 46#include <sys/time.h>SwivelHingeJoint.cs https://hg01.codeplex.com/bepuphysics | C# | 134 lines
24 IsActive = false; 25 BallSocketJoint = new BallSocketJoint(); 26 AngularJoint = new SwivelHingeAngularJoint(); 31 32 Add(BallSocketJoint); 33 Add(AngularJoint); 52 connectionB = TwoEntityConstraint.WorldEntity; 53 BallSocketJoint = new BallSocketJoint(connectionA, connectionB, anchor); 54 AngularJoint = new SwivelHingeAngularJoint(connectionA, connectionB, hingeAxis, -BallSocketJoint.OffsetB); 56 HingeMotor = new RevoluteMotor(connectionA, connectionB, hingeAxis); 57 TwistLimit = new TwistLimit(connectionA, connectionB, BallSocketJoint.OffsetA, -BallSocketJoint.OffsetB, 0, 0); 58 TwistMotor = new TwistMotor(connectionA, connectionB, BallSocketJoint.OffsetA, -BallSocketJoint.OffsetB); 111 /// </summary> 112 public BallSocketJoint BallSocketJoint { get; private set; } 113TcpServer.fs git://github.com/fractureio/fracture.git | F# | 0 lines
21 let connections = ref 0 22 let listeningSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) 23 let mutable disposed = false 50 and processAccept (args) = 51 let acceptSocket = args.AcceptSocket 52 match args.SocketError with 82 | SocketError.Disconnecting when disposed -> ()// stop accepting here, we're being shutdown. 83 | _ -> Debug.WriteLine (sprintf "socket error on accept: %A" args.SocketError) 84 91 let socket = sd.Socket 92 if args.SocketError = SocketError.Success && args.BytesTransferred > 0 then 93 //process received data, check if data was given on connection. 116 failwith "Buffer overflow or send buffer timeout" //graceful termination? 117 | _ -> args.SocketError.ToString() |> printfn "socket error on send: %s" 118GCDetailAttrib.h http://mmo-resourse.googlecode.com/svn/ | C Header | 318 lines
30 //?????? 31 virtual BOOL Read( SocketInputStream& iStream ) ; 32 virtual BOOL Write( SocketOutputStream& oStream )const ;config.h.in git://pkgs.fedoraproject.org/radiusclient-ng | Autoconf | 235 lines
60 61/* Define to 1 if you have the `socket' library (-lsocket). */ 62#undef HAVE_LIBSOCKETconfig.h.in git://pkgs.fedoraproject.org/aprsd | Autoconf | 240 lines
72 73/* Define to 1 if you have the `socket' function. */ 74#undef HAVE_SOCKET 124 125/* Define to 1 if you have the <sys/socket.h> header file. */ 126#undef HAVE_SYS_SOCKET_HProxyClientFactory.cs http://counterstrike.googlecode.com/svn/trunk/ | C# | 209 lines
28using System.Text; 29using System.Net.Sockets; 30 72 /// // create a connection through the proxy to www.starksoft.com over port 80 73 /// System.Net.Sockets.TcpClient tcpClient = proxy.CreateConnection("www.starksoft.com", 80); 74 /// </code>NSSelectSet_windows.m https://code.google.com/p/cocotron/ | Objective C | 443 lines
276 277 result->pingWrite=[[NSSocket alloc] initConnectedToSocket:&result->pingRead]; 278 [result->pingRead retain]; 330 NSEnumerator *state=[set objectEnumerator]; 331 NSSocket_windows *socket; 332 333 while((socket=[state nextObject])!=nil) 334 native_set_set(native,[socket socketHandle]); 335} 340 for(i=0;i<native->fdset->fd_count;i++) 341 [set addObject:[[[NSSocket_windows alloc] initWithSocketHandle:native->fdset->fd_array[i]] autorelease]]; 342} 401 NSError *result=nil; 402 NSSocket_windows *cheater=[NSSocket_windows socketWithSocketHandle:0]; 403 NSTimeInterval interval=[beforeDate timeIntervalSinceNow];SolrConfiguration.java https://github.com/apache/camel.git | Java | 389 lines
150 /** 151 * Sets the socket timeout on the SolrClient 152 */misultin_websocket.erl git://pkgs.fedoraproject.org/erlang-misultin | Erlang | 280 lines
107% Close socket and custom handling loop dependency 108-spec websocket_close(Socket::socket(), WsHandleLoopPid::pid(), SocketMode::socketmode(), WsAutoExit::boolean()) -> ok. 109websocket_close(Socket, WsHandleLoopPid, SocketMode, WsAutoExit) -> 173-spec ws_loop(WsHandleLoopPid::pid(), SessionsRef::pid(), Ws::#ws{}, State::term()) -> ok. 174ws_loop(WsHandleLoopPid, SessionsRef, #ws{vsn = Vsn, socket = Socket, socket_mode = SocketMode, ws_autoexit = WsAutoExit} = Ws, State) -> 175 misultin_socket:setopts(Socket, [{active, once}], SocketMode), 261-spec handle_data_receive(SessionsRef::pid(), WsHandleLoopPid::pid(), Data::binary(), Ws::#ws{}, State::term()) -> ok. 262handle_data_receive(SessionsRef, WsHandleLoopPid, Data, #ws{vsn = Vsn, socket = Socket, socket_mode = SocketMode, ws_autoexit = WsAutoExit} = Ws, State) -> 263 VsnMod = get_module_name_from_vsn(Vsn), 265 websocket_close -> 266 misultin_websocket:websocket_close(Socket, WsHandleLoopPid, SocketMode, WsAutoExit); 267 {websocket_close, CloseData} -> 268 misultin_socket:send(Socket, CloseData, SocketMode), 269 misultin_websocket:websocket_close(Socket, WsHandleLoopPid, SocketMode, WsAutoExit); 270 NewState ->BindLdapHandler.java git://github.com/liferay/liferay-portal.git | Java | 347 lines
36 37import java.net.InetSocketAddress; 38 102 if (Validator.isNull(saslHostName)) { 103 InetSocketAddress inetSocketAddress = 104 (InetSocketAddress)ioSession.getLocalAddress(); 105 106 saslHostName = inetSocketAddress.getHostName(); 107 }CLChatServer.java git://pkgs.fedoraproject.org/javanotes | Java | 157 lines
11 * This program only supports one connection. As soon as a connection is 12 * opened, the listening socket is closed down. The two ends of the connection 13 * each send a HANDSHAKE string to the other, so that both ends can verify 49 50 ServerSocket listener; // Listens for a connection request. 51 Socket connection; // For communication with the client. 82 try { 83 listener = new ServerSocket(port); 84 System.out.println("Listening on port " + listener.getLocalPort());libnet_raw.c git://pkgs.fedoraproject.org/libnet | C | 264 lines
87 88 l->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); 89 if (l->fd == -1) 101 * The IPv4 layer generates an IP header when sending a packet unless 102 * the IP_HDRINCL socket option is enabled on the socket. When it 103 * is enabled, the packet must contain an IP header. For 123/* 124 * man 7 socket 125 * 125 * 126 * Sets and gets the maximum socket send buffer in bytes. 127 * 140 { 141 if (setsockopt(l->fd, SOL_SOCKET, SO_SNDBUF, &n, len) < 0) 142 {tutdaytime5.html git://github.com/barrbrain/asio.git | HTML | 107 lines
33<p> 34 Create an <a class="link" href="../reference/ip__udp/socket.html" title="ip::udp::socket">ip::udp::socket</a> 35 object to receive requests on UDP port 13. 36 </p> 37<pre class="programlisting"> <span class="identifier">udp</span><span class="special">::</span><span class="identifier">socket</span> <span class="identifier">socket</span><span class="special">(</span><span class="identifier">io_service</span><span class="special">,</span> <span class="identifier">udp</span><span class="special">::</span><span class="identifier">endpoint</span><span class="special">(</span><span class="identifier">udp</span><span class="special">::</span><span class="identifier">v4</span><span class="special">(),</span> <span class="number">13</span><span class="special">));</span> 38</pre> 40 Wait for a client to initiate contact with us. The remote_endpoint object 41 will be populated by <a class="link" href="../reference/basic_datagram_socket/receive_from.html" title="basic_datagram_socket::receive_from">ip::udp::socket::receive_from()</a>. 42 </p> 47 <span class="identifier">asio</span><span class="special">::</span><span class="identifier">error_code</span> <span class="identifier">error</span><span class="special">;</span> 48 <span class="identifier">socket</span><span class="special">.</span><span class="identifier">receive_from</span><span class="special">(</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">recv_buf</span><span class="special">),</span> 49 <span class="identifier">remote_endpoint</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">error</span><span class="special">);</span> 62<pre class="programlisting"> <span class="identifier">asio</span><span class="special">::</span><span class="identifier">error_code</span> <span class="identifier">ignored_error</span><span class="special">;</span> 63 <span class="identifier">socket</span><span class="special">.</span><span class="identifier">send_to</span><span class="special">(</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">message</span><span class="special">),</span> 64 <span class="identifier">remote_endpoint</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">ignored_error</span><span class="special">);</span>Handle.pm http://perl5005.googlecode.com/svn/trunk/ | Perl | 540 lines
177trampling on each other I propose the that any such module should prefix 178its variables with its own name separated by _'s. For example the IO::Socket 179module keeps a C<timeout> variable in 'io_socket_timeout'.newcmdwin32.cc git://github.com/darconeous/sdcc.git | C++ | 633 lines
96 shutdown((SOCKET)handle, SD_BOTH); 97 closesocket((SOCKET)handle); 98 } 295 296 if (INVALID_SOCKET != (sock = make_server_socket(serverport))) 297 { 310 ACCEPT_SOCKLEN_T size = sizeof(struct sockaddr); 311 SOCKET newsock = accept((SOCKET)get_in_fd(), (struct sockaddr*)&sock_addr, &size); 312 312 313 if (INVALID_SOCKET == newsock) 314 { 336 fprintf(stderr, "Can't open port for output\n"); 337 cl_channel ch_out = cl_channel(fp, CH_SOCKET); 338irc2you-server.py https://code.google.com/p/irc2you/ | Python | 268 lines
67 pid, uid, gid = struct.unpack('3i', \ 68 self.request.getsockopt(socket.SOL_SOCKET, 17, \ 69 struct.calcsize('3i'))) 171 channel = objectify.fromstring(messageXML, getNick) 172 for conection in listofSockets: 173 if str(channel.returnport) in conection: 198 pid, uid, gid = struct.unpack('3i', \ 199 self.request.getsockopt(socket.SOL_SOCKET, 17, \ 200 struct.calcsize('3i'))) 250 # Set named socket path and delete old socket, if any 251 namedsocket = os.path.join(tempfile.gettempdir(), 'irc2you_socket') 252 if(os.path.exists(namedsocket)): 253 os.remove(namedsocket) 254 #server = SocketServer.UnixStreamServer(namedsocket, MyHandler) 255 server = ThreadingUnixStreamServer(namedsocket, MyHandler)lutil.h git://pkgs.fedoraproject.org/openldap | C++ Header | 362 lines
221LDAP_LUTIL_F( int ) 222lutil_pair( ber_socket_t sd[2] ); 223cloudlaunch.go git://github.com/bradfitz/camlistore.git | Go | 457 lines
87 RestartNever 88 // TODO: more graceful restarts; make systemd own listening on network sockets, 89 // don't break connections.winrt_ssocket_service_base.hpp git://github.com/mongodb/mongo.git | C++ Header | 358 lines
1// 2// detail/winrt_ssocket_service_base.hpp 3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 10 11#ifndef BOOST_ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP 12#define BOOST_ASIO_DETAIL_WINRT_SSOCKET_SERVICE_BASE_HPP 24#include <boost/asio/io_service.hpp> 25#include <boost/asio/socket_base.hpp> 26#include <boost/asio/detail/addressof.hpp> 27#include <boost/asio/detail/buffer_sequence_adapter.hpp> 28#include <boost/asio/detail/socket_types.hpp> 29#include <boost/asio/detail/winrt_async_manager.hpp> 42 // The native type of a socket. 43 typedef Windows::Networking::Sockets::StreamSocket^ native_handle_type; 44test_asyncore.py http://unladen-swallow.googlecode.com/svn/trunk/ | Python | 415 lines
31 def __init__(self): 32 self.socket = dummysocket() 33 195 if usedefault: 196 socketmap = asyncore.socket_map 197 try: 200 finally: 201 testmap, asyncore.socket_map = asyncore.socket_map, socketmap 202 else: 333 self.evt = threading.Event() 334 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 335 self.sock.settimeout(3) 347 d = dispatcherwithsend_noread() 348 d.create_socket(socket.AF_INET, socket.SOCK_STREAM) 349 d.connect((HOST, self.port))SOCK_Connector.cpp git://github.com/insider42/mangos.git | C++ | 363 lines
6#include "ace/OS_NS_unistd.h" 7#include "ace/OS_NS_sys_socket.h" 8#include "ace/os_include/os_fcntl.h" 37 38 // Only open a new socket if we don't already have a valid handle. 39 if (new_stream.get_handle () == ACE_INVALID_HANDLE 59 60 // Only open a new socket if we don't already have a valid handle. 61 if (new_stream.get_handle () == ACE_INVALID_HANDLE 121#if defined(ACE_WIN32) 122 // In order to detect when the socket that has been 123 // bound to is in TIME_WAIT we need to do the connect 128 // error state. The error code is then retrieved with 129 // getsockopt(). Good sockets however will return from 130 // the select() with ETIME - in this case returnTCPTransportClient.java http://mobicents.googlecode.com/svn/trunk/ | Java | 367 lines
98 } 99 socketChannel = SelectorProvider.provider().openSocketChannel(); 100 if (origAddress != null) { 116 socketChannel.configureBlocking(true); 117 destAddress = new InetSocketAddress(socket.getInetAddress(), socket.getPort()); 118 } 122 if(socketDescription == null && socketChannel != null) { 123 socketDescription = socketChannel.socket().toString(); 124 } 187 public void stop() throws Exception { 188 logger.debug("Stopping transport. Socket is [{}]", socketDescription); 189 stop = true; 273 boolean isConnected() { 274 return socketChannel != null && socketChannel.isConnected(); 275 }sckaddr.h http://dynamica.googlecode.com/svn/trunk/ | C Header | 324 lines
20#elif defined(__VMS__) 21 #include <socket.h> 22 31 #include <sys/types.h> 32 #include <sys/socket.h> 33 #include <netinet/in.h> 65 66#ifdef wxHAS_UNIX_DOMAIN_SOCKETS 67template <> struct AddressFamily<sockaddr_un> { enum { value = AF_UNIX }; }; 67template <> struct AddressFamily<sockaddr_un> { enum { value = AF_UNIX }; }; 68#endif // wxHAS_UNIX_DOMAIN_SOCKETS 69 73 74// Represents a socket endpoint, e.g. an (address, port) pair for PF_INET 75// sockets. It can be initialized from an existing sockaddr struct and alsoDatabaseMysql.cpp https://github.com/Lirok/mangos.git | C++ | 447 lines
91 92 std::string host, port_or_socket, user, password, database; 93 int port; 93 int port; 94 char const* unix_socket; 95 100 if(iter != tokens.end()) 101 port_or_socket = *iter++; 102 if(iter != tokens.end()) 115 port = 0; 116 unix_socket = 0; 117 } 129 port = 0; 130 unix_socket = port_or_socket.c_str(); 131 }meteobox.c git://github.com/Yniold/liftsrc.git | C | 353 lines
46#include <pthread.h> 47#include <sys/socket.h> 48#include <sys/types.h> 126{ 127 .iFD = -1, /* socket FD */ 128 .Valid = 0, /* signal if data is valid or not to main thread */ 138 139// bind to socket and create the parser thread 140// 175 176 // socket structure 177 struct sockaddr_in ServerAddress; 187 188 // create SocketFD 189 sStructure->iFD = socket(AF_INET, SOCK_STREAM, 0);dlmast.c git://github.com/torvalds/linux.git | C | 487 lines
20#include <linux/blkdev.h> 21#include <linux/socket.h> 22#include <linux/inet.h>print-sctp.P https://gitlab.com/kidaa/HDTheatre.git | Prolog | 110 lines
24 bionic/libc/include/pathconf.h bionic/libc/include/netdb.h \ 25 bionic/libc/include/sys/socket.h \ 26 bionic/libc/kernel/common/linux/socket.h \ 26 bionic/libc/kernel/common/linux/socket.h \ 27 bionic/libc/kernel/arch-x86/asm/socket.h \ 28 bionic/libc/kernel/arch-x86/asm/sockios.h \ 78 bionic/libc/include/pathconf.h bionic/libc/include/netdb.h : 79 bionic/libc/include/sys/socket.h : 80 bionic/libc/kernel/common/linux/socket.h : 80 bionic/libc/kernel/common/linux/socket.h : 81 bionic/libc/kernel/arch-x86/asm/socket.h : 82 bionic/libc/kernel/arch-x86/asm/sockios.h :CassandraConnectionFactory.cs https://hg.codeplex.com/netcassa | C# | 164 lines
126 127 TSocket socket = new TSocket(dns.Host, dns.Port); 128 socket.TcpClient.NoDelay = true; 128 socket.TcpClient.NoDelay = true; 129 return new TFramedTransport(socket); 130 }