PageRenderTime 946ms queryTime 104ms sortTime 418ms getByIdsTime 59ms findMatchingLines 36ms

100+ results results for 'socket repo:razeto/lap' (946 ms)

Not the results you expected?
NioSelectorPool.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 304 lines
                    
141     * @param buf ByteBuffer - the buffer containing the data, we will write as long as <code>(buf.hasRemaining()==true)</code>
                    
142     * @param socket SocketChannel - the socket to write data to
                    
143     * @param selector Selector - the selector to use for blocking, if null then a busy write will be initiated
                    
201     * @param buf ByteBuffer - the buffer containing the data, we will read as until we have read at least one byte or we timed out
                    
202     * @param socket SocketChannel - the socket to write data to
                    
203     * @param selector Selector - the selector to use for blocking, if null then a busy read will be initiated
                    
206     * @throws EOFException if read returns -1
                    
207     * @throws SocketTimeoutException if the read times out
                    
208     * @throws IOException if an IO Exception occurs in the underlying socket logic
                    
209     */
                    
210    public int read(ByteBuffer buf, NioChannel socket, Selector selector, long readTimeout) throws IOException {
                    
211        return read(buf,socket,selector,readTimeout,true);
                    
218     * @param buf ByteBuffer - the buffer containing the data, we will read as until we have read at least one byte or we timed out
                    
219     * @param socket SocketChannel - the socket to write data to
                    
220     * @param selector Selector - the selector to use for blocking, if null then a busy read will be initiated
                    
                
RecordingInputStream.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 369 lines
                    
30import java.io.InputStream;
                    
31import java.net.SocketException;
                    
32import java.net.SocketTimeoutException;
                    
211                }
                    
212            } catch (SocketTimeoutException e) {
                    
213                // A socket timeout is just a transient problem, meaning
                    
220                if (logger.isLoggable(Level.FINE)) {
                    
221                    logger.log(Level.FINE, "socket timeout", e); 
                    
222                }
                    
224                recordingOutputStream.checkLimits();
                    
225            } catch (SocketException se) {
                    
226                throw se;
                    
                
plans.scala https://github.com/dwestheide/Unfiltered.git | Scala | 316 lines
                    
64
                    
65/** a light wrapper around both Sec-WebSocket-Draft + Sec-WebSocket-Version headers */
                    
66private [websockets] object Version {
                    
153  import jnetty.channel.{ChannelStateEvent, ExceptionEvent}
                    
154  import jnetty.handler.codec.http.websocket.{DefaultWebSocketFrame, WebSocketFrame,
                    
155                                             WebSocketFrameDecoder => LegacyWebSocketFrameDecoder,
                    
162
                    
163  val SecWebSocketLocation = "Sec-WebSocket-Location"
                    
164  val SecWebSocketOrigin = "Sec-WebSocket-Origin"
                    
197
                    
198            def attempt = socketIntent.orElse({ case _ => () }: Plan.SocketIntent)
                    
199
                    
251
                    
252            pipe.replace(this, ctx.getName, SocketPlan(socketIntent, pass))
                    
253
                    
                
ReverseVirtualSocket.java https://github.com/interdroid/smartsockets.git | Java | 445 lines
                    
144    /**
                    
145     * @see ibis.smartsockets.virtual.VirtualSocket#getLocalSocketAddress()
                    
146     */
                    
190    /**
                    
191     * @see ibis.smartsockets.virtual.VirtualSocket#getRemoteSocketAddress()
                    
192     */
                    
368     * @throws SocketException
                    
369     * @see ibis.smartsockets.virtual.modules.direct.DirectVirtualSocket#setSendBufferSize(int)
                    
370     */
                    
405     * @throws SocketException
                    
406     * @see ibis.smartsockets.virtual.VirtualSocket#setTrafficClass(int)
                    
407     */
                    
428    /**
                    
429     * @see ibis.smartsockets.virtual.modules.direct.DirectVirtualSocket#toString()
                    
430     */
                    
                
dfindServer.ml https://github.com/tstarling/hiphop-php.git | OCaml | 407 lines
                    
199(*****************************************************************************)
                    
200(* Generic code to create a socket in Ocaml *)
                    
201(*****************************************************************************)
                    
202
                    
203let server_socket, client_socket =
                    
204  let tmp = Filename.temp_dir_name in
                    
211      let domain = Unix.PF_UNIX in
                    
212      let sock = Unix.socket domain Unix.SOCK_STREAM 0 in
                    
213      let _ = Unix.bind sock sockaddr in
                    
222      let domain = Unix.PF_UNIX in
                    
223      let sock = Unix.socket domain Unix.SOCK_STREAM 0 in
                    
224      Unix.connect sock sockaddr ;
                    
393      DfindMaybe.set_log env.log;
                    
394      let socket = server_socket () in
                    
395      lock_pid_file();
                    
                
auth.go https://gitlab.com/masterlike/masterlike-bot | Go | 467 lines
                    
97	for socket.cachedNonce == "" && socket.dead == nil {
                    
98		debugf("Socket %p to %s: waiting for nonce", socket, socket.addr)
                    
99		socket.gotNonce.Wait()
                    
131		}
                    
132		debugf("Socket %p to %s: nonce unmarshalled: %#v", socket, socket.addr, result)
                    
133		if result.Code == 13390 {
                    
180
                    
181	debugf("Socket %p to %s: login: db=%q user=%q", socket, socket.addr, cred.Source, cred.Username)
                    
182
                    
198	} else {
                    
199		debugf("Socket %p to %s: login successful", socket, socket.addr)
                    
200	}
                    
461			copy(socket.logout[i:], socket.logout[i+1:])
                    
462			socket.logout = socket.logout[:len(socket.logout)-1]
                    
463			return true
                    
                
link.c https://github.com/CyanogenMod/android_external_iproute2.git | C | 476 lines
                    
5#include <time.h>
                    
6#include <sys/socket.h>
                    
7#include <sys/time.h>
                    
                
base.js https://bitbucket.org/james_gibson/goo-api.git | JavaScript | 465 lines
                    
315      // Unpack the connection settings
                    
316      var _host = info.connection.socketOptions.host;
                    
317      var _port = info.connection.socketOptions.port;
                    
                
remote_fetcher.rb https://gitlab.com/pooja043/Globus_Docker_3 | Ruby | 507 lines
                    
62
                    
63    Socket.do_not_reverse_lookup = true
                    
64
                    
244    raise FetchError.new('timed out', uri.to_s)
                    
245  rescue IOError, SocketError, SystemCallError => e
                    
246    raise FetchError.new("#{e.class}: #{e}", uri.to_s)
                    
                
ipn.php https://github.com/kpike/moodle.git | PHP | 327 lines
                    
98
                    
99if (!$fp) {  /// Could not open a socket to PayPal - FAIL
                    
100    echo "<p>Error: could not access paypal.com</p>";
                    
                
netop.c https://gitlab.com/envieidoc/tomato | C | 528 lines
                    
21#include <sys/types.h>
                    
22#include <sys/socket.h>
                    
23#include <arpa/inet.h>
                    
62    do {
                    
63        lsock = socket( AF_INET, SOCK_STREAM, 0 );
                    
64        if( -1 == lsock ) break;
                    
82
                    
83        rc = setsockopt( lsock, SOL_SOCKET, SO_REUSEADDR,
                    
84                         &ON, sizeof(ON) );
                    
95        TRACE( (void)tmfprintf (g_flog, "Setting low watermark for "
                    
96            "server socket [%d] to [%d]\n", lsock, wmark) );
                    
97        rc = setsockopt (lsock, SOL_SOCKET, SO_RCVLOWAT,
                    
115        if(errno)
                    
116            mperror(g_flog, errno, "%s: socket/bind/listen error",
                    
117                    __func__);
                    
                
pptp_callmgr.c https://gitlab.com/envieidoc/tomato | C | 388 lines
                    
10#include <sys/stat.h>
                    
11#include <sys/socket.h>
                    
12#include <netinet/in.h>
                    
121        fatal("Invalid IP address: %s", argv[1]);
                    
122    /* Step 1: Open sockets. */
                    
123    if ((inet_sock = open_inetsock(inetaddr)) < 0)
                    
125    if ((unix_sock = open_unixsock(inetaddr)) < 0)
                    
126        fatal("Could not open unix socket for %s", argv[1]);
                    
127    /* Step 1b: FORK and return status to calling process. */
                    
137    file2fd("/dev/null", "wb", STDERR_FILENO);
                    
138    /* Step 1c: Clean up unix socket on TERM */
                    
139    if (sigsetjmp(callmgr_env, 1) != 0)
                    
187	    break;
                    
188        /* Step 5b: Handle new connection to UNIX socket */
                    
189        if (FD_ISSET(unix_sock, &read_set)) {
                    
                
board-dm365-evm.c https://github.com/defer/kernel_zte_blade.git | C | 491 lines
                    
100
                    
101/* NOTE:  this is geared for the standard config, with a socketed
                    
102 * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors.  If you
                    
                
JdwpMain.c https://github.com/schiznik/android_dalvik.git | C | 415 lines
                    
63    switch (pParams->transport) {
                    
64    case kJdwpTransportSocket:
                    
65        // LOGD("prepping for JDWP over TCP\n");
                    
65        // LOGD("prepping for JDWP over TCP\n");
                    
66        state->transport = dvmJdwpSocketTransport();
                    
67        break;
                    
                
gitaly_client_spec.rb https://gitlab.com/wolfgang42/gitlab-ce | Ruby | 419 lines
                    
127
                    
128    context 'when passed a UNIX socket address' do
                    
129      it 'passes the address as-is to GRPC' do
                    
                
adm_err.c https://github.com/richlowe/illumos-gate.git | C | 520 lines
                    
443		return(dgettext(TEXT_DOMAIN,
                    
444			"Could not create socket"));
                    
445	case 144:
                    
449		return(dgettext(TEXT_DOMAIN,
                    
450			"Could not fetch local socket address"));
                    
451	case 146:
                    
                
3.8.3.md https://github.com/rabbitmq/rabbitmq-server.git | Markdown | 305 lines
                    
41
                    
42 * Reduced scheduled GC activity in connection socket writer to one run per 1 GiB of data transferred, with an option to change the value or disable scheduled run entirely.
                    
43   More frequent binary heap GC runs seem unneccesary on Erlang 22.
                    
                
int_homun.c https://gitlab.com/gumiko/hercules | C | 367 lines
                    
31#include "common/showmsg.h"
                    
32#include "common/socket.h"
                    
33#include "common/sql.h"
                    
                
openvswitch.m4 https://bitbucket.org/devzero2000/openvswitch.git | m4 | 356 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])])
                    
                
packet_dispatcher.rb https://bitbucket.org/cfield/metasploit-framework.git | Ruby | 544 lines
                    
237	#
                    
238	def monitor_socket
                    
239
                    
297				rescue ::Exception
                    
298					dlog("Exception caught in monitor_socket: #{$!}", 'meterpreter', LEV_1)
                    
299					@finish = true
                    
305
                    
306		# Spawn a new thread that monitors the socket
                    
307		self.dispatcher_thread = Rex::ThreadFactory.spawn("MeterpreterDispatcher", false) do
                    
383				if(@pqueue.length > 100)
                    
384					dlog("Backlog has grown to over 100 in monitor_socket, dropping older packets: #{@pqueue[0 .. 25].map{|x| x.inspect}.join(" - ")}", 'meterpreter', LEV_1)
                    
385					@pqueue = @pqueue[25 .. 100]
                    
388			rescue ::Exception => e
                    
389				dlog("Exception caught in monitor_socket dispatcher: #{e.class} #{e} #{e.backtrace}", 'meterpreter', LEV_1)
                    
390			ensure
                    
                
mach-gta02.c https://github.com/devpress-xx/linux-2.6.git | C | 582 lines
                    
147 * On GTA02 the 1A charger features a 48K resistor to 0V on the ID pin.
                    
148 * We use this to recognize that we can pull 1A from the USB socket.
                    
149 *
                    
                
dispatch_spec.rb https://github.com/Gonzih/diaspora.git | Ruby | 338 lines
                    
133            it 'calls socket_to_users' do
                    
134              @mailman.should_receive(:socket_to_users).with([@local_leia, @local_luke])
                    
135              @mailman.post
                    
157          end
                    
158          it 'calls socket_to_users' do
                    
159            @mailman.should_receive(:socket_to_users).with([@local_leia])
                    
206        end
                    
207        it 'does not call socket_to_users' do
                    
208          @mailman.should_not_receive(:socket_to_users)
                    
320
                    
321      it 'only tries to socket when the object responds to #socket_to_user' do
                    
322        f = Request.new
                    
333        Resque.should_receive(:enqueue).with(Job::NotifyLocalUsers, [bob.id], @sm.class.to_s, @sm.id, @sm.author.id)
                    
334        @zord.send(:socket_and_notify_users, [bob])
                    
335      end
                    
                
SOCK_Connector.cpp https://github.com/origins/CactusEMU.git | C++ | 365 lines
                    
6#include "ace/OS_NS_unistd.h"
                    
7#include "ace/OS_NS_sys_socket.h"
                    
8#include "ace/os_include/os_fcntl.h"
                    
39
                    
40  // Only open a new socket if we don't already have a valid handle.
                    
41  if (new_stream.get_handle () == ACE_INVALID_HANDLE
                    
61
                    
62  // Only open a new socket if we don't already have a valid handle.
                    
63  if (new_stream.get_handle () == ACE_INVALID_HANDLE
                    
123#if defined(ACE_WIN32)
                    
124              // In order to detect when the socket that has been
                    
125              // bound to is in TIME_WAIT we need to do the connect
                    
130              // error state. The error code is then retrieved with
                    
131              // getsockopt(). Good sockets however will return from
                    
132              // the select() with ETIME - in this case return
                    
                
README.md https://gitlab.com/nguyenthehiep3232/marius | Markdown | 495 lines
                    
3[![Version npm](https://img.shields.io/npm/v/ws.svg?logo=npm)](https://www.npmjs.com/package/ws)
                    
4[![CI](https://img.shields.io/github/workflow/status/websockets/ws/CI/master?label=CI&logo=github)](https://github.com/websockets/ws/actions?query=workflow%3ACI+branch%3Amaster)
                    
5[![Coverage Status](https://img.shields.io/coveralls/websockets/ws/master.svg?logo=coveralls)](https://coveralls.io/github/websockets/ws)
                    
15communication. Browser clients must use the native
                    
16[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
                    
17object. To make the same code work seamlessly on Node.js and the browser, you
                    
288
                    
289A client WebSocket broadcasting to all connected WebSocket clients, including
                    
290itself.
                    
461
                    
462const client = new WebSocket('wss://echo.websocket.org/');
                    
463
                    
494[ws-server-options]:
                    
495  https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback
                    
496
                    
                
intel.c https://github.com/EnJens/kernel_2.6.36_nvidia_base.git | C | 531 lines
                    
87	 *
                    
88	 * It is also reliable across cores and sockets. (but not across
                    
89	 * cabinets - we turn it off in that case explicitly.)
                    
                
AMLauncher.java https://github.com/rbodkin/hadoop-common.git | Java | 288 lines
                    
21import java.io.IOException;
                    
22import java.net.InetSocketAddress;
                    
23import java.nio.ByteBuffer;
                    
160        return (ContainerManager) rpc.getProxy(ContainerManager.class,
                    
161            NetUtils.createSocketAddr(containerManagerBindAddress), conf);
                    
162      }
                    
228              YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS);
                    
229      InetSocketAddress unresolvedAddr =
                    
230          NetUtils.createSocketAddr(schedulerAddressStr);
                    
                
winrt_ssocket_service_base.hpp https://gitlab.com/cdeclare/intcrypt | C++ Header | 357 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;
                    
44
                    
                
oz-gpe.patch https://github.com/e3c/openembedded.git | Patch | 466 lines
                    
138     fclose(inf);
                    
139     if (strncmp(buf, "Socket 0: empty", 15 ) == 0) {
                    
140-//	if (old_cf_status != 0) {
                    
                
unistd.h https://github.com/peterzjin/kernel-omap.git | C Header | 402 lines
                    
84#define __NR_fstatfs            100
                    
85#define __NR_socketcall         102
                    
86#define __NR_syslog             103
                    
372#define __ARCH_WANT_SYS_UTIME
                    
373#define __ARCH_WANT_SYS_SOCKETCALL
                    
374#define __ARCH_WANT_SYS_FADVISE64
                    
                
misultin_websocket.erl https://bitbucket.org/joneshf/cloudi.git | Erlang | 279 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 ->
                    
                
test_in_http.rb https://gitlab.com/vectorci/fluentd | Ruby | 442 lines
                    
8    def startup
                    
9      socket_manager_path = ServerEngine::SocketManager::Server.generate_path
                    
10      @server = ServerEngine::SocketManager::Server.open(socket_manager_path)
                    
10      @server = ServerEngine::SocketManager::Server.open(socket_manager_path)
                    
11      ENV['SERVERENGINE_SOCKETMANAGER_PATH'] = socket_manager_path.to_s
                    
12    end
                    
                
HttpConnectionPoolBuilder.java https://gitlab.com/vincent.hsu/cyberduck | Java | 253 lines
                    
42import org.apache.http.config.SocketConfig;
                    
43import org.apache.http.conn.socket.ConnectionSocketFactory;
                    
44import org.apache.http.conn.socket.PlainConnectionSocketFactory;
                    
126                                        final ProxyFinder proxy,
                    
127                                        final SocketFactory socketFactory) {
                    
128        this(host, new PlainConnectionSocketFactory() {
                    
129            @Override
                    
130            public Socket createSocket(final HttpContext context) throws IOException {
                    
131                return socketFactory.createSocket();
                    
157    public HttpConnectionPoolBuilder(final Host host,
                    
158                                     final ConnectionSocketFactory socketFactory,
                    
159                                     final ConnectionSocketFactory sslSocketFactory,
                    
186        final int timeout = preferences.getInteger("connection.timeout.seconds") * 1000;
                    
187        builder.setDefaultSocketConfig(SocketConfig.custom()
                    
188                .setTcpNoDelay(true)
                    
                
index.js https://gitlab.com/josephm9/304CEM-CW | JavaScript | 328 lines
                    
211
                    
212  describe('unix domain sockets', function(){
                    
213    it('without auth', function(done){
                    
                
types.h https://github.com/max3903/SFLphone.git | C Header | 544 lines
                    
164/**
                    
165 * Media socket info is used to describe the underlying sockets
                    
166 * to be used as media transport.
                    
169{
                    
170    /** The RTP socket handle */
                    
171    pj_sock_t	    rtp_sock;
                    
173    /** Address to be advertised as the local address for the RTP
                    
174     *  socket, which does not need to be equal as the bound
                    
175     *  address (for example, this address can be the address resolved
                    
179
                    
180    /** The RTCP socket handle. */
                    
181    pj_sock_t	    rtcp_sock;
                    
183    /** Address to be advertised as the local address for the RTCP
                    
184     *  socket, which does not need to be equal as the bound
                    
185     *  address (for example, this address can be the address resolved
                    
                
https.d.ts https://gitlab.com/girmayegebremedhin/student_managment | TypeScript Typings | 156 lines
                    
49        addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
                    
50        addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
                    
51        addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
                    
96        once(event: string, listener: (...args: any[]) => void): this;
                    
97        once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
                    
98        once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
                    
118        prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
                    
119        prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
                    
120        prependListener(event: 'close', listener: () => void): this;
                    
130        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
                    
131        prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
                    
132        prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
                    
135        prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
                    
136        prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
                    
137        prependOnceListener(event: 'close', listener: () => void): this;
                    
                
ieee80211_crypto_ccmp.c https://bitbucket.org/kmv/aeriebsd-src.git | C | 465 lines
                    
22#include <sys/kernel.h>
                    
23#include <sys/socket.h>
                    
24#include <sys/sockio.h>
                    
                
if_art.c https://bitbucket.org/kmv/aeriebsd-src.git | C | 447 lines
                    
21#include <sys/proc.h>
                    
22#include <sys/socket.h>
                    
23#include <sys/sockio.h>
                    
                
HttpGatewayTest.java https://github.com/objectiser/switchyard-components.git | Java | 280 lines
                    
18import java.io.PrintStream;
                    
19import java.net.InetSocketAddress;
                    
20import java.util.HashSet;
                    
213    public void httpTimeout() throws Exception {
                    
214        HttpServer httpServer = HttpServer.create(new InetSocketAddress(8090), 10);
                    
215        httpServer.setExecutor(null); // creates a default executor
                    
228            e.printStackTrace(new PrintStream(baos));
                    
229            Assert.assertTrue(baos.toString().contains("SocketTimeoutException: Read timed out"));
                    
230        }
                    
235    public void authentication() throws Exception {
                    
236        HttpServer httpServer = HttpServer.create(new InetSocketAddress(8100), 10);
                    
237        httpServer.setExecutor(null); // creates a default executor
                    
                
IPAddress.cs https://bitbucket.org/luobailiang/mono.git | C# | 511 lines
                    
31using System.Globalization;
                    
32using System.Net.Sockets;
                    
33using System.Runtime.InteropServices;
                    
42		// Don't change the name of this field without also
                    
43		// changing socket-io.c in the runtime
                    
44		// The IP address is stored in little-endian order inside the int, 
                    
368				if (m_Family != AddressFamily.InterNetworkV6)
                    
369					throw new SocketException ((int) SocketError.OperationNotSupported);
                    
370
                    
374				if (m_Family != AddressFamily.InterNetworkV6)
                    
375					throw new SocketException ((int) SocketError.OperationNotSupported);
                    
376				if ((value < 0) || (value > UInt32.MaxValue))
                    
                
ext_mysql.h https://bitbucket.org/gnanakeethan/hiphop-php.git | C Header | 378 lines
                    
47  static int GetDefaultPort();
                    
48  static String GetDefaultSocket();
                    
49  static String GetDefaultUsername() { return String();}
                    
55   */
                    
56  static MySQL *GetPersistent(CStrRef host, int port, CStrRef socket,
                    
57                              CStrRef username, CStrRef password,
                    
58                              int client_flags) {
                    
59    return GetCachedImpl("mysql::persistent_conns", host, port, socket,
                    
60                         username, password, client_flags);
                    
62
                    
63  static void SetPersistent(CStrRef host, int port, CStrRef socket,
                    
64                            CStrRef username, CStrRef password,
                    
65                            int client_flags, MySQL *conn) {
                    
66    SetCachedImpl("mysql::persistent_conns", host, port, socket,
                    
67                  username, password, client_flags, conn);
                    
                
test_socket.rb https://github.com/idletekz/ruby.git | Ruby | 461 lines
                    
23  def test_sysaccept
                    
24    serv = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
                    
25    serv.bind(Socket.sockaddr_in(0, "127.0.0.1"))
                    
26    serv.listen 5
                    
27    c = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
                    
28    c.connect(serv.getsockname)
                    
37  def test_initialize
                    
38    Socket.open(Socket::AF_INET, Socket::SOCK_STREAM, 0) {|s|
                    
39      s.bind(Socket.sockaddr_in(0, "127.0.0.1"))
                    
63  def test_getaddrinfo_raises_no_errors_on_port_argument_of_0 # [ruby-core:29427]
                    
64    assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
                    
65    assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '0', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
                    
66    assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '00', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
                    
67    assert_raise(SocketError, '[ruby-core:29427]'){ Socket.getaddrinfo(nil, nil, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
                    
68    assert_nothing_raised('[ruby-core:29427]'){ TCPServer.open('localhost', 0) {} }
                    
                
test_smtplib.py https://bitbucket.org/glix/python.git | Python | 412 lines
                    
42        self.evt = threading.Event()
                    
43        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                    
44        self.sock.settimeout(15)
                    
71        self.assertTrue(socket.getdefaulttimeout() is None)
                    
72        socket.setdefaulttimeout(30)
                    
73        try:
                    
85        finally:
                    
86            socket.setdefaulttimeout(None)
                    
87        self.assertTrue(smtp.sock.gettimeout() is None)
                    
106        n = 1000
                    
107        while asyncore.socket_map and n > 0:
                    
108            poll_fun(0.01, asyncore.socket_map)
                    
256        self.evt = threading.Event()
                    
257        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                    
258        self.sock.settimeout(15)
                    
                
TrustSpecifiedOkHttpClient.java https://gitlab.com/samuel-davis/DDF-TestSource | Java | 301 lines
                    
49    X509TrustManager trustManager;
                    
50    SSLSocketFactory sslSocketFactory;
                    
51
                    
60      );
                    
61      sslSocketFactory = sslContext.getSocketFactory();
                    
62    } catch (GeneralSecurityException e) {
                    
68    builder.readTimeout(readTimeout, TimeUnit.SECONDS);
                    
69    builder.sslSocketFactory(sslSocketFactory, trustManager);
                    
70
                    
82    X509TrustManager trustManager;
                    
83    SSLSocketFactory sslSocketFactory;
                    
84    ArrayList<String> certArray = getCertDirectoryFileNames();
                    
94      );
                    
95      sslSocketFactory = sslContext.getSocketFactory();
                    
96    } catch (GeneralSecurityException e) {
                    
                
module-util.html https://bitbucket.org/esatterwhite/wallace-io.git | HTML | 769 lines
                    
271						<li>
                    
272							<a href="module-XDM.Socket.html">Socket</a>
                    
273						</li>
                    
                
introduction.html https://bitbucket.org/preining/tex-live.git | HTML | 333 lines
                    
21<tr><td align=center><a href="http://www.lua.org">
                    
22<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
                    
23</a></td></tr>
                    
61The API design had two goals in mind. First, users
                    
62experienced with the C API to sockets should feel comfortable using LuaSocket.
                    
63Second, the simplicity and the feel of the Lua language should be
                    
130Master sockets are newly created TCP sockets returned by the function
                    
131<a href=tcp.html#tcp><tt>socket.tcp</tt></a>. A master socket is 
                    
132transformed into a server socket
                    
182-- load namespace
                    
183local socket = require("socket")
                    
184-- create a TCP socket and bind it to the local host, at any port
                    
287-- load namespace
                    
288local socket = require("socket")
                    
289-- convert host name to ip address
                    
                
workhorse_spec.rb https://gitlab.com/Ben305/gitlab-ce | Ruby | 454 lines
                    
99
                    
100  describe '.terminal_websocket' do
                    
101    def terminal(ca_pem: nil)
                    
125    context 'without ca_pem' do
                    
126      subject { described_class.terminal_websocket(terminal) }
                    
127
                    
131    context 'with ca_pem' do
                    
132      subject { described_class.terminal_websocket(terminal(ca_pem: "foo")) }
                    
133
                    
                
select.c https://bitbucket.org/ddevine/haiku.git | C | 492 lines
                    
85static BOOL
                    
86IsSocketHandle(HANDLE h)
                    
87{
                    
95  ev.lNetworkEvents = 0xDEADBEEF;
                    
96  WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
                    
97  return ev.lNetworkEvents != 0xDEADBEEF;
                    
324
                    
325  /* Classify handles.  Create fd sets for sockets, poll the others. */
                    
326  for (i = 0; i < nfds; i++)
                    
337
                    
338      if (IsSocketHandle (h))
                    
339        {
                    
341
                    
342          /* See above; socket handles are mapped onto select, but we
                    
343             need to map descriptors to handles.  */
                    
                
w.c https://bitbucket.org/killerpenguinassassins/open_distrib_devel.git | C | 528 lines
                    
56#include <sys/ioctl.h>
                    
57#include <sys/socket.h>
                    
58#include <sys/tty.h>
                    
                
buffer.c https://bitbucket.org/palday/fieldtrip.git | C | 450 lines
                    
98
                    
99	/* clean up host/address/socket list and close open sockets */
                    
100	while (firstHostPortSock != NULL) {
                    
104			if (verbose) {
                    
105				printf("Closing socket and ");
                    
106			}
                    
119
                    
120/** This function searches through the linked list to retrieve the socket number
                    
121	of the first (and only) item with matching hostname and port. 
                    
167/* This function searches the item with matching socket number and removes it from the list 
                    
168	Note: The socket itself is not closed here.
                    
169*/
                    
189	it means that the connection is still open (at least from this side), and
                    
190	we can just return the corresponding socket.
                    
191	Otherwise, we try to connect using the normal open_connection, and
                    
                
http.pm https://bitbucket.org/preining/tex-live.git | Perl | 501 lines
                    
29
                    
30    local($^W) = 0;  # IO::Socket::INET can be noisy
                    
31    my $sock = $self->socket_class->new(PeerAddr => $host,
                    
161    # connect to remote site
                    
162    my $socket = $self->_new_socket($host, $port, $timeout);
                    
163
                    
322		my $buf = $socket->_rbuf;
                    
323		my $n = $socket->sysread($buf, 1024, length($buf));
                    
324                unless (defined $n) {
                    
395    if ($method eq "CONNECT") {
                    
396	$response->{client_socket} = $socket;  # so it can be picked up
                    
397	return $response;
                    
436	    {
                    
437		$conn_cache->deposit($self->socket_type, "$host:$port", $socket);
                    
438	    }
                    
                
arvcameratest.c https://gitlab.com/subin.plakkannickal/aravis | C | 420 lines
                    
17static int arv_option_gain = -1;
                    
18static gboolean arv_option_auto_socket_buffer = FALSE;
                    
19static gboolean arv_option_no_packet_resend = FALSE;
                    
26static gboolean arv_option_high_priority = FALSE;
                    
27static gboolean arv_option_no_packet_socket = FALSE;
                    
28static char *arv_option_chunks = NULL;
                    
78		"auto",					'a', 0, G_OPTION_ARG_NONE,
                    
79		&arv_option_auto_socket_buffer,		"Auto socket buffer size", NULL
                    
80	},
                    
118		"no-packet-socket",			'\0', 0, G_OPTION_ARG_NONE,
                    
119		&arv_option_no_packet_socket,		"Disable use of packet socket", NULL
                    
120	},
                    
341					g_object_set (stream,
                    
342						      "socket-buffer", ARV_GV_STREAM_SOCKET_BUFFER_AUTO,
                    
343						      "socket-buffer-size", 0,
                    
                
upnp.go https://gitlab.com/shinvdu/syncthing | Go | 440 lines
                    
129
                    
130	socket, err := net.ListenMulticastUDP("udp4", intf, &net.UDPAddr{IP: ssdp.IP})
                    
131	if err != nil {
                    
134	}
                    
135	defer socket.Close() // Make sure our socket gets closed
                    
136
                    
136
                    
137	err = socket.SetDeadline(time.Now().Add(timeout))
                    
138	if err != nil {
                    
144
                    
145	_, err = socket.WriteTo(search, ssdp)
                    
146	if err != nil {
                    
155		resp := make([]byte, 65536)
                    
156		n, _, err := socket.ReadFrom(resp)
                    
157		if err != nil {
                    
                
process.c https://gitlab.com/grayhamster/io.js | C | 524 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);
                    
204
                    
                
xpc_partition.c https://github.com/penberg/linux.git | C | 534 lines
                    
146	}
                    
147	rp = (struct xpc_rsvd_page *)__va(xp_socket_pa(rp_pa));
                    
148
                    
                
main.cc https://bitbucket.org/kbw/wb-samples.git | C++ | 522 lines
                    
54	int getHandle() const;
                    
55	zmq::socket_t* getSocket() const;
                    
56
                    
133
                    
134zmq::socket_t* Stream::getSocket() const
                    
135{
                    
276
                    
277			if (zmq::socket_t* zsock = pstream->getSocket()) {
                    
278				zmq_pollitem_t rec = { static_cast<void*>(zsock), -1, zmq_mode, 0 };
                    
412	if (Bundle* reader_bundle = new Bundle("reader")) {
                    
413		zmq::socket_t* pub = new zmq::socket_t(ctx, zmq::socket_type::pub);
                    
414		pub->bind("inproc://news.znc");
                    
422	if (Bundle* writer_bundle = new Bundle("writer")) {
                    
423		zmq::socket_t* sub = new zmq::socket_t(ctx, zmq::socket_type::sub);
                    
424		sub->connect("inproc://news.znc");
                    
                
jboss-as-mod-cluster_1_2.xsd https://gitlab.com/mucadoo/geo-marvel | XML Schema | 277 lines
                    
48
                    
49        <!-- Get the actual advertiseGroupAddress / advertisePort from advertiseSocket -->
                    
50        <xs:attribute name="advertise-socket" type="xs:string" use="optional"/>
                    
75        </xs:attribute>
                    
76        <xs:attribute name="socket-timeout" type="xs:int" use="optional" default="20">
                    
77            <xs:annotation>
                    
185                <xs:documentation>
                    
186                    sslProtocol: Overrides the default SSL socket protocol.
                    
187                </xs:documentation>
                    
                
connect.hpp https://github.com/BorisSchaeling/asio.git | C++ Header | 389 lines
                    
51template <typename Protocol, typename SocketService, typename Iterator>
                    
52inline Iterator connect(basic_socket<Protocol, SocketService>& s,
                    
53    Iterator begin, asio::error_code& ec)
                    
68template <typename Protocol, typename SocketService, typename Iterator>
                    
69inline Iterator connect(basic_socket<Protocol, SocketService>& s,
                    
70    Iterator begin, Iterator end, asio::error_code& ec)
                    
177  public:
                    
178    connect_op(basic_socket<Protocol, SocketService>& sock,
                    
179        const Iterator& begin, const Iterator& end,
                    
256  //private:
                    
257    basic_socket<Protocol, SocketService>& socket_;
                    
258    Iterator iter_;
                    
354    typename ConnectCondition, typename ComposedConnectHandler>
                    
355inline void async_connect(basic_socket<Protocol, SocketService>& s,
                    
356    Iterator begin, ConnectCondition connect_condition,
                    
                
CDProtocol.java https://gitlab.com/Moylle/CDAPI | Java | 481 lines
                    
14	public AfterVerificationDelegate afterVerification;
                    
15	Socket socket;
                    
16	InputStream inputStream;
                    
42	
                    
43	public CDProtocol(Socket socket, int maxLength, int buf_capacity, boolean incomming) throws Exception
                    
44	{
                    
46	}
                    
47	public CDProtocol(Socket socket, int maxLength, int buf_capacity, boolean incomming, String hashedKeyWord, DataInputObject dio, RawDataInputObject dioRaw, boolean useBigEndian) throws Exception
                    
48	{
                    
48	{
                    
49		this.socket = socket;
                    
50		this.inputStream = socket.getInputStream();
                    
272	{
                    
273		return this.socket != null && this.socket.isConnected();
                    
274	}
                    
                
record-handler.js https://gitlab.com/jasonparser/deepstream.io | JavaScript | 369 lines
                    
111 *
                    
112 * @param   {SocketWrapper} socketWrapper the socket that send the request
                    
113 * @param   {Object} message parsed and validated message
                    
133 *
                    
134 * @param   {SocketWrapper} socketWrapper the socket that send the request
                    
135 * @param   {Object} message parsed and validated message
                    
171 * @param {Object} record
                    
172 * @param {SocketWrapper} socketWrapper the socket that send the request
                    
173 *
                    
204 * 
                    
205 * @param   {SocketWrapper} socketWrapper the socket that send the request
                    
206 * @param   {Object} message parsed and validated message
                    
346 *
                    
347 * @param   {SocketWrapper} socketWrapper the socket that send the request
                    
348 * @param   {Object} message parsed and validated message
                    
                
WeiXinSvcImpl.java https://gitlab.com/spiderworts/ab_pc_cms | Java | 358 lines
                    
27import org.apache.http.conn.scheme.SchemeRegistry;
                    
28import org.apache.http.conn.ssl.SSLSocketFactory;
                    
29import org.apache.http.entity.StringEntity;
                    
312	            ctx.init(null, new TrustManager[] { tm }, null);
                    
313	            SSLSocketFactory ssf = new SSLSocketFactory(ctx);
                    
314	            ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
                    
                
mpisocketserver.h https://gitlab.com/benbelga/muscleHPC | C Header | 405 lines
                    
265
                    
266class SocketManager: public SocketServer{
                    
267
                    
305//********************************** TCPSocketManager *******************************************
                    
306class TCPSocketManager: public SocketManager{
                    
307
                    
327
                    
328class SocketKernel: public SocketServer{
                    
329
                    
377
                    
378class MpiSocketKernel: public SocketKernel{
                    
379
                    
391
                    
392class TCPSocketKernel: public SocketKernel{
                    
393
                    
                
client.js https://gitlab.com/oytunistrator/x3dom | JavaScript | 495 lines
                    
53
                    
54    "socketTimeout": function(test){
                    
55        var client = simplesmtp.connect(PORT_NUMBER, false, {socketTimeout: 500});
                    
                
endpoint.html https://bitbucket.org/liflg/library-boost.git | HTML | 340 lines
                    
66                    The type of the endpoint structure. This type is dependent on
                    
67                    the underlying implementation of the socket layer.
                    
68                  </p>
                    
116                    Default constructor. <br> <span class="silver"> &#8212;</span><br> Construct an endpoint from
                    
117                    the specified socket address. <br> <span class="silver"> &#8212;</span><br> Construct an endpoint
                    
118                    from the specific endpoint type. <br> <span class="silver"> &#8212;</span><br> Copy constructor.
                    
293          The <a class="link" href="../generic__basic_endpoint.html" title="generic::basic_endpoint"><code class="computeroutput">generic::basic_endpoint</code></a>
                    
294          class template describes an endpoint that may be associated with any socket
                    
295          type.
                    
301<p>
                    
302          The socket types sockaddr type must be able to fit into a <code class="computeroutput">sockaddr_storage</code>
                    
303          structure.
                    
                
ClientFTP.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 179 lines
                    
54    protected StringBuilder controlConversation;
                    
55    protected Socket dataSocket;
                    
56
                    
71     *            the path of the file to retrieve
                    
72     * @return the socket to read data from, or null if server says not found,
                    
73     *         permission denied, etc
                    
76     */
                    
77    public Socket openDataConnection(int command, String path)
                    
78    throws IOException {
                    
79        try {
                    
80            dataSocket = _openDataConnection_(command, path);
                    
81            if (dataSocket != null) {
                    
82                recordAdditionalInfo("Opened data connection to "
                    
83                        + dataSocket.getInetAddress().getHostAddress() + ":"
                    
84                        + dataSocket.getPort());
                    
                
Krb5AndCertsSslSocketConnector.Krb5SslFilter.html https://gitlab.com/essere.lab.public/qualitas.class-corpus | HTML | 144 lines
                    
6<TITLE>
                    
7Uses of Class org.apache.hadoop.security.Krb5AndCertsSslSocketConnector.Krb5SslFilter (Hadoop 1.1.2 API)
                    
8</TITLE>
                    
17    if (location.href.indexOf('is-external=true') == -1) {
                    
18        parent.document.title="Uses of Class org.apache.hadoop.security.Krb5AndCertsSslSocketConnector.Krb5SslFilter (Hadoop 1.1.2 API)";
                    
19    }
                    
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
                    
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../org/apache/hadoop/security/Krb5AndCertsSslSocketConnector.Krb5SslFilter.html" title="class in org.apache.hadoop.security"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD>
                    
43  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD>
                    
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
                    
61  <A HREF="../../../../../index.html?org/apache/hadoop/security//class-useKrb5AndCertsSslSocketConnector.Krb5SslFilter.html" target="_top"><B>FRAMES</B></A>  &nbsp;
                    
62&nbsp;<A HREF="Krb5AndCertsSslSocketConnector.Krb5SslFilter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
                    
83<H2>
                    
84<B>Uses of Class<br>org.apache.hadoop.security.Krb5AndCertsSslSocketConnector.Krb5SslFilter</B></H2>
                    
85</CENTER>
                    
                
ColumbaServer.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 251 lines
                    
22import java.io.PrintWriter;
                    
23import java.net.ServerSocket;
                    
24import java.net.Socket;
                    
40/**
                    
41 * Opens a server socket to manage multiple sessions of Columba capable of
                    
42 * passing commands to the main session.
                    
81	 */
                    
82	protected ServerSocket serverSocket;
                    
83
                    
102				try {
                    
103					serverSocket.close();
                    
104
                    
135				try {
                    
136					serverSocket = new ServerSocket(port);
                    
137
                    
                
RuntimeEnabledFeatures.cpp https://gitlab.com/x33n/phantomjs | C++ | 213 lines
                    
36#include "SharedWorkerRepository.h"
                    
37#include "WebSocket.h"
                    
38
                    
143
                    
144#if ENABLE(WEB_SOCKETS)
                    
145bool RuntimeEnabledFeatures::webSocketEnabled()
                    
146{
                    
147    return WebSocket::isAvailable();
                    
148}
                    
                
util.h https://bitbucket.org/codefirex/kernel_samsung_jf.git | C Header | 268 lines
                    
69#include <sys/poll.h>
                    
70#include <sys/socket.h>
                    
71#include <sys/ioctl.h>
                    
                
core-connection.h https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | C Header | 169 lines
                    
31
                    
32// Socket timeout in millisec (set to 5 seconds)
                    
33#define CORE_PORT_TIMEOUT_MS    5000
                    
38 * Return:
                    
39 *  Sync socket descriptor on success, or -1 on failure, with errno appropriately
                    
40 *  set.
                    
41 */
                    
42SyncSocket* core_connection_open_socket(SockAddress* sockaddr);
                    
43
                    
45 * Param:
                    
46 *  console_socket Socket address for the console.
                    
47 * Return:
                    
125/* Creates a console client, and switches it to a given stream.
                    
126 *  console_socket Socket address for the console.
                    
127 *  stream_name Name of the stream to switch to.
                    
                
swarmnode.yaml https://gitlab.com/unofficial-mirrors/openstack-magnum | YAML | 459 lines
                    
296
                    
297  write_docker_socket:
                    
298    type: "OS::Heat::SoftwareConfig"
                    
300      group: ungrouped
                    
301      config: {get_file: ../../common/templates/swarm/fragments/write-docker-socket.yaml}
                    
302
                    
340          params:
                    
341            "$NODE_SERVICES": "docker.socket docker swarm-agent"
                    
342
                    
381        - config: {get_resource: add_docker_daemon_options}
                    
382        - config: {get_resource: write_docker_socket}
                    
383        - config: {get_resource: add_proxy}
                    
                
getprotoent.c https://bitbucket.org/cooljeanius/dragonflybsd.git | C | 549 lines
                    
35#include <sys/types.h>
                    
36#include <sys/socket.h>
                    
37#include <errno.h>
                    
                
README.md https://gitlab.com/rickyvaughn2/Pi-GPIO-Server | Markdown | 243 lines
                    
1# angular-socket-io [![Build Status](https://travis-ci.org/btford/angular-socket-io.png)](https://travis-ci.org/btford/angular-socket-io)
                    
2
                    
91. `bower install angular-socket-io` or [download the zip](https://github.com/btford/angular-socket-io/archive/master.zip).
                    
102. Make sure the Socket.IO client lib is loaded. It's often served at `/socket.io/socket.io.js`.
                    
113. Include the `socket.js` script provided by this component into your app.
                    
80
                    
81`socket.forward` allows you to forward the events received by Socket.IO's socket to AngularJS's event system.
                    
82You can then listen to the event with `$scope.$on`.
                    
129
                    
130This option allows you to provide the `socket` service with a `Socket.IO socket` object to be used internally.
                    
131This is useful if you want to connect on a different path, or need to hold a reference to the `Socket.IO socket` object for use elsewhere.
                    
140  mySocket = socketFactory({
                    
141    ioSocket: myIoSocket
                    
142  });
                    
223]).
                    
224factory('socket', function (socketFactory) {
                    
225  return socketFactory({
                    
                
OrderedMemoryAwareThreadPoolExecutor.java https://github.com/maerqiang/netty.git | Java | 337 lines
                    
85 *         // uses identity comparison only (see {@link IdentityHashMap}).
                    
86 *         // Because SocketAddress does not work with identity comparison,
                    
87 *         // we need to employ more generic implementation.
                    
92 *         // Use the IP of the remote peer as a key.
                    
93 *         return ((InetSocketAddress) e.getChannel().getRemoteAddress()).getAddress();
                    
94 *     }
                    
                
TcpTransport.java https://github.com/Cyberqat/Red-Dwarf.git | Java | 359 lines
                    
26import com.sun.sgs.nio.channels.AsynchronousServerSocketChannel;
                    
27import com.sun.sgs.nio.channels.AsynchronousSocketChannel;
                    
28import com.sun.sgs.nio.channels.CompletionHandler;
                    
35import java.net.InetAddress;
                    
36import java.net.InetSocketAddress;
                    
37import java.util.Properties;
                    
76 *      argument to the
                    
77 *      {@link AsynchronousServerSocketChannel#bind(SocketAddress,int)
                    
78 *      AsynchronousServerSocketChannel.bind} method.
                    
103    /** The listen address. */
                    
104    final InetSocketAddress listenAddress;
                    
105    
                    
119    /** The acceptor for listening for new connections. */
                    
120    volatile AsynchronousServerSocketChannel acceptor;
                    
121
                    
                
core.py https://github.com/pib/python-xmpp-server.git | Python | 461 lines
                    
36    def __repr__(self):
                    
37        peer = self.stream.socket and self.stream.socket.getpeername()
                    
38        return '<%s %r>' % (type(self).__name__, peer)
                    
267    def use_tls(self):
                    
268        return bool(ssl and self.stream.socket)
                    
269
                    
                
Server.java https://github.com/hsablonniere/play.git | Java | 166 lines
                    
5import java.net.InetAddress;
                    
6import java.net.InetSocketAddress;
                    
7import java.util.Properties;
                    
11import org.jboss.netty.channel.ChannelException;
                    
12import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
                    
13
                    
67        }
                    
68        ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
                    
69                Executors.newCachedThreadPool(), Executors.newCachedThreadPool())
                    
73                bootstrap.setPipelineFactory(new HttpServerPipelineFactory());
                    
74                bootstrap.bind(new InetSocketAddress(address, httpPort));
                    
75                bootstrap.setOption("child.tcpNoDelay", true);
                    
97
                    
98        bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
                    
99                Executors.newCachedThreadPool(), Executors.newCachedThreadPool())
                    
                
tcp_probe.c https://bitbucket.org/danhamilt1/linux.git | C | 260 lines
                    
24#include <linux/kprobes.h>
                    
25#include <linux/socket.h>
                    
26#include <linux/tcp.h>
                    
                
best-practice-security.md https://gitlab.com/HDworley/expressjs.com | Markdown | 205 lines
                    
27
                    
28您可能熟悉 Secure Socket Layer (SSL) 加密。[TLS 就是 SSL 後繼的演進](https://msdn.microsoft.com/en-us/library/windows/desktop/aa380515(v=vs.85).aspx)。換句話說,如果您之前使用 SSL,請考量升級至 TLS。一般而言,我們建議由 Nginx 來處理 TLS。如需有關在 Nginx(和其他伺服器)上配置 TLS 的適當參考資料,請參閱 [Recommended Server Configurations (Mozilla Wiki)](https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_Server_Configurations)。
                    
29
                    
                
in_rmx.c https://bitbucket.org/cooljeanius/dragonflybsd.git | C | 459 lines
                    
49#include <sys/sysctl.h>
                    
50#include <sys/socket.h>
                    
51#include <sys/mbuf.h>
                    
                
ixgbe.h https://bitbucket.org/cooljeanius/dragonflybsd.git | C Header | 514 lines
                    
43#include <sys/protosw.h>
                    
44#include <sys/socket.h>
                    
45#include <sys/malloc.h>
                    
                
Makefile.in https://github.com/cciechad/brlcad.git | Autoconf | 466 lines
                    
157LIBSGIGL = @LIBSGIGL@
                    
158LIBSOCKET = @LIBSOCKET@
                    
159LIBSTDCXX = @LIBSTDCXX@
                    
                
il2simulator.cpp https://github.com/CorvusCorax/my_OpenPilot_mods.git | C++ | 363 lines
                    
98{
                    
99        inSocket->connectToHost(host,inPort); // IL2
                    
100        if(!inSocket->waitForConnected())
                    
121        QByteArray data = cmd.toAscii();
                    
122        //outSocket->write(data);
                    
123        inSocket->write(data);  // for IL2 must send to the same port as input!!!!!!!!!!!!!
                    
                
TcpTransport.java https://github.com/Cyberqat/Red-Dwarf.git | Java | 390 lines
                    
77 *      argument to the
                    
78 *      {@link AsynchronousServerSocketChannel#bind(SocketAddress,int)
                    
79 *      AsynchronousServerSocketChannel.bind} method.
                    
131
                    
132    /** The client socket timeout */
                    
133    private final Integer socketTimeout;
                    
138    /** The acceptor for listening for new connections. */
                    
139    volatile AsynchronousServerSocketChannel acceptor;
                    
140
                    
169
                    
170        socketTimeout = wrappedProps.getIntProperty(SOCKET_TIMEOUT_PROPERTY,
                    
171                                                    0, 0, Integer.MAX_VALUE);
                    
219                       "\n  " + LISTEN_PORT_PROPERTY + "=" + port +
                    
220                       "\n  " + SOCKET_TIMEOUT_PROPERTY + "=" + socketTimeout);
                    
221
                    
                
analyze.h https://bitbucket.org/encukou/patched-po.git | C Header | 187 lines
                    
139    /* The connection to the outside */
                    
140    Network &socket();
                    
141    const Network &socket() const;
                    
142    /* To tell if its the registry we're connected to*/
                    
143    bool registry_socket;
                    
144
                    
147
                    
148    Network mysocket;
                    
149};
                    
                
netlink.h https://bitbucket.org/apanda/ovs-ddc.git | C Header | 164 lines
                    
30 * For Netlink protocol definitions, see netlink-protocol.h.  For
                    
31 * Linux-specific definitions for Netlink sockets, see netlink-socket.h.
                    
32 */
                    
                
logger.cc https://gitlab.com/jonnialva90/iridium-browser | C++ | 366 lines
                    
139
                    
140void Logger::LogNewSocketEvent(const CastSocket& cast_socket) {
                    
141  DCHECK(thread_checker_.CalledOnValidThread());
                    
148  aggregated_socket_event.set_endpoint_id(ip.back());
                    
149  aggregated_socket_event.set_channel_auth_type(cast_socket.channel_auth() ==
                    
150                                                        CHANNEL_AUTH_TYPE_SSL
                    
300
                    
301  std::deque<proto::SocketEvent>& socket_events = it->second->socket_events;
                    
302  if (socket_events.size() >= kMaxEventsPerSocket) {
                    
326        log.add_aggregated_socket_event();
                    
327    new_aggregated_socket_event->CopyFrom(it->second->aggregated_socket_event);
                    
328
                    
328
                    
329    const std::deque<SocketEvent>& socket_events = it->second->socket_events;
                    
330    for (std::deque<SocketEvent>::const_iterator socket_event_it =
                    
                
58-debug_spec.js https://gitlab.com/farm-assistant/nodered | JavaScript | 338 lines
                    
19var helper = require("../../helper.js");
                    
20var WebSocket = require('ws');
                    
21
                    
46            var n1 = helper.getNode("n1");
                    
47            websocket_test(function() {
                    
48                n1.emit("input", {payload:"test"});
                    
62            var count = 0;
                    
63            websocket_test(function() {
                    
64                n1.emit("input", {payload:"test"});
                    
91            var n1 = helper.getNode("n1");
                    
92            websocket_test(function() {
                    
93                n1.emit("input", {payload:"test"});
                    
106            var n1 = helper.getNode("n1");
                    
107            websocket_test(function() {
                    
108                n1.emit("input", {payload:"test", foo:"bar"});
                    
                
NetworkElement.h https://github.com/midnightcoder/gracula.git | C Header | 344 lines
                    
47
                    
48    class ServerSocket;
                    
49
                    
106    pthread_t socketListenerThread; // thread which will listen to the port
                    
107    pthread_attr_t socketListenerAttr;
                    
108    static bool stopListenerThreadFlag; // control flag used to make listener thread finish and return.
                    
108    static bool stopListenerThreadFlag; // control flag used to make listener thread finish and return.
                    
109    static bool socketListenerIsReady; // control flag used to indicate listener is ready.
                    
110
                    
127
                    
128    static std::vector<ServerSocket*> serverSockets;
                    
129
                    
269    // ***********************************************/
                    
270    // ServerSocket call-back
                    
271
                    
                
test_ump.c https://github.com/edwardbadboy/user-message-protocol.git | C | 307 lines
                    
19#include "../user_message_protocol/ump_public.h"
                    
20void send_data(UMPSocket *u_sock);
                    
21void receive_data(UMPSocket *u_sock);
                    
21void receive_data(UMPSocket *u_sock);
                    
22void send_file(UMPSocket *u_sock,char* filename);
                    
23void receive_file(UMPSocket *u_sock,char* filename);
                    
71	UMPCore* u_core;
                    
72	UMPSocket* u_sock;
                    
73	struct sockaddr_in our,their;
                    
194
                    
195void send_data(UMPSocket *u_sock)
                    
196{
                    
217
                    
218void receive_data(UMPSocket *u_sock)
                    
219{
                    
                
callback.c https://github.com/fopina/ZTE-Joe-Kernel-2.6.29.git | C | 257 lines
                    
84		/*
                    
85		 * Listen for a request on the socket
                    
86		 */
                    
163out_err:
                    
164	dprintk("NFS: Couldn't create callback socket or server thread; "
                    
165		"err = %d\n", ret);
                    
                
cardbus.c https://github.com/fopina/ZTE-Joe-Kernel-2.6.29.git | C | 252 lines
                    
86    cards.  The "result" that is used externally is the cb_cis_virt
                    
87    pointer in the struct pcmcia_socket structure.
                    
88    
                    
90
                    
91static void cb_release_cis_mem(struct pcmcia_socket * s)
                    
92{
                    
100
                    
101static int cb_setup_cis_mem(struct pcmcia_socket * s, struct resource *res)
                    
102{
                    
129
                    
130int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void *ptr)
                    
131{
                    
209
                    
210int __ref cb_alloc(struct pcmcia_socket * s)
                    
211{
                    
                
SslSocketConnector.html https://github.com/djKianoosh/jQuery_workshop.git | HTML | 145 lines
                    
7<TITLE>
                    
8Uses of Class org.eclipse.jetty.server.ssl.SslSocketConnector (Jetty :: Hightide Distribution 7.2.1.v20101111 API)
                    
9</TITLE>
                    
18    if (location.href.indexOf('is-external=true') == -1) {
                    
19        parent.document.title="Uses of Class org.eclipse.jetty.server.ssl.SslSocketConnector (Jetty :: Hightide Distribution 7.2.1.v20101111 API)";
                    
20    }
                    
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
                    
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../org/eclipse/jetty/server/ssl/SslSocketConnector.html" title="class in org.eclipse.jetty.server.ssl"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD>
                    
44  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD>
                    
61<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
                    
62  <A HREF="../../../../../../index.html?org/eclipse/jetty/server/ssl//class-useSslSocketConnector.html" target="_top"><B>FRAMES</B></A>  &nbsp;
                    
63&nbsp;<A HREF="SslSocketConnector.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
                    
84<H2>
                    
85<B>Uses of Class<br>org.eclipse.jetty.server.ssl.SslSocketConnector</B></H2>
                    
86</CENTER>
                    
                
genetlink.h https://github.com/goldelico/gta04-kernel.git | C Header | 405 lines
                    
219 * genlmsg_put_reply - Add generic netlink header to a reply message
                    
220 * @skb: socket buffer holding the message
                    
221 * @info: receiver info
                    
238 * genlmsg_end - Finalize a generic netlink message
                    
239 * @skb: socket buffer the message is stored in
                    
240 * @hdr: user specific header
                    
248 * genlmsg_cancel - Cancel construction of a generic netlink message
                    
249 * @skb: socket buffer the message is stored in
                    
250 * @hdr: generic netlink message header
                    
261 * @net: the net namespace
                    
262 * @skb: netlink message as socket buffer
                    
263 * @portid: own netlink portid to avoid sending to yourself
                    
279 * @family: the generic netlink family
                    
280 * @skb: netlink message as socket buffer
                    
281 * @portid: own netlink portid to avoid sending to yourself
                    
                
package-use.html https://github.com/jclouds/jclouds-maven-site.git | HTML | 302 lines
                    
180<TR BGCOLOR="white" CLASS="TableRowColor">
                    
181<TD><B><A HREF="../../../../org/jclouds/compute/predicates/class-use/RetryIfSocketNotYetOpen.html#org.jclouds.compute.functions"><B>RetryIfSocketNotYetOpen</B></A></B>
                    
182
                    
201<TR BGCOLOR="white" CLASS="TableRowColor">
                    
202<TD><B><A HREF="../../../../org/jclouds/compute/predicates/class-use/RetryIfSocketNotYetOpen.html#org.jclouds.compute.predicates"><B>RetryIfSocketNotYetOpen</B></A></B>
                    
203
                    
222<TR BGCOLOR="white" CLASS="TableRowColor">
                    
223<TD><B><A HREF="../../../../org/jclouds/compute/predicates/class-use/RetryIfSocketNotYetOpen.html#org.jclouds.compute.strategy"><B>RetryIfSocketNotYetOpen</B></A></B>
                    
224
                    
237<TR BGCOLOR="white" CLASS="TableRowColor">
                    
238<TD><B><A HREF="../../../../org/jclouds/compute/predicates/class-use/RetryIfSocketNotYetOpen.html#org.jclouds.compute.util"><B>RetryIfSocketNotYetOpen</B></A></B>
                    
239
                    
                
svr-x11fwd.c https://gitlab.com/envieidoc/tomato | C | 241 lines
                    
64
                    
65	/* create listening socket */
                    
66	fd = socket(PF_INET, SOCK_STREAM, 0);
                    
84
                    
85	/* listener code will handle the socket now.
                    
86	 * No cleanup handler needed, since listener_remove only happens
                    
103
                    
104/* accepts a new X11 socket */
                    
105/* returns DROPBEAR_FAILURE or DROPBEAR_SUCCESS */
                    
235		/* otherwise it was an error we don't know about */
                    
236		dropbear_log(LOG_DEBUG, "Failed to bind x11 socket");
                    
237		break;
                    
                
errno.h https://gitlab.com/envieidoc/tomato | C Header | 139 lines
                    
99#define	EUSERS		87	/* Too many users */
                    
100#define	ENOTSOCK	88	/* Socket operation on non-socket */
                    
101#define	EDESTADDRREQ	89	/* Destination address required */
                    
102#define	EMSGSIZE	90	/* Message too long */
                    
103#define	EPROTOTYPE	91	/* Protocol wrong type for socket */
                    
104#define	ENOPROTOOPT	92	/* Protocol not available */
                    
105#define	EPROTONOSUPPORT	93	/* Protocol not supported */
                    
106#define	ESOCKTNOSUPPORT	94	/* Socket type not supported */
                    
107#define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */
                    
                
configure.in https://gitlab.com/envieidoc/tomato | Autoconf | 239 lines
                    
55	CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
                    
56	LDFLAGS="-lxnet -ldevinfo -lnsl -lsocket -lrt"
                    
57fi
                    
94AC_TRY_COMPILE([#include <sys/types.h>
                    
95#include <sys/socket.h>],
                    
96	[socklen_t x;  x = 1; return x;],
                    
115AC_TYPE_SIGNAL
                    
116AC_CHECK_FUNCS(mktime select socket)
                    
117AC_CHECK_FUNCS(clock_gettime)
                    
210 #include <sys/types.h>
                    
211 #include <sys/socket.h>
                    
212 ], [ 
                    
                
MemoryFileSystem.js https://gitlab.com/limorelv/trelloApp | JavaScript | 225 lines
                    
57			isFIFO: falseFn,
                    
58			isSocket: falseFn
                    
59		};
                    
67			isFIFO: falseFn,
                    
68			isSocket: falseFn
                    
69		};
                    
                
vhci_sysfs.c https://gitlab.com/webhaikal/SenseiOneplus3 | C | 252 lines
                    
41	 * output example:
                    
42	 * prt sta spd dev socket           local_busid
                    
43	 * 000 004 000 000         c5a7bb80 1-2.3
                    
45	 *
                    
46	 * IP address can be retrieved from a socket pointer address by looking
                    
47	 * up /proc/net/{tcp,tcp6}. Also, a userland program may remember a
                    
50	out += sprintf(out,
                    
51		       "prt sta spd bus dev socket           local_busid\n");
                    
52
                    
175	struct vhci_device *vdev;
                    
176	struct socket *socket;
                    
177	int sockfd = 0;
                    
225	vdev->speed         = speed;
                    
226	vdev->ud.tcp_socket = socket;
                    
227	vdev->ud.status     = VDEV_ST_NOTASSIGNED;
                    
                
ConstituentParserServer.java https://gitlab.com/neuralconcept/NLPthirdParty | Java | 195 lines
                    
27import java.io.UnsupportedEncodingException;
                    
28import java.net.ServerSocket;
                    
29import java.net.Socket;
                    
74    String kafToString;
                    
75    ServerSocket socketServer = null;
                    
76    Socket activeSocket;
                    
82      System.out.println("-> Trying to listen port... " + port);
                    
83      socketServer = new ServerSocket(port);
                    
84      System.out.println("-> Connected and listening to port " + port);
                    
86        try {
                    
87          activeSocket = socketServer.accept();
                    
88          inFromClient = new BufferedReader(new InputStreamReader(activeSocket.getInputStream(), "UTF-8"));
                    
88          inFromClient = new BufferedReader(new InputStreamReader(activeSocket.getInputStream(), "UTF-8"));
                    
89          outToClient = new BufferedWriter(new OutputStreamWriter(activeSocket.getOutputStream(), "UTF-8"));
                    
90          //get data from client
                    
                
 

Source

Language