626,242 results for 'socket repo:peromax/imgstream' (18 ms)
os_net.c https://github.com/paulcbetts/yikes.git | C | 1,395 lines
1055/* size = 4; 1056 if (getsockopt(sock->socket, SOL_SOCKET, SO_TYPE, (char *) &fam, &size) == SOCKET_ERROR) 1057 return GF_IP_NETWORK_FAILURE; 1322{ 1323 GF_SocketGroup *tmp = (GF_SocketGroup*)malloc(sizeof(GF_SocketGroup)); 1324 if (!tmp) return NULL; 1340 1341void SKG_AddSocket(GF_SocketGroup *group, GF_Socket *sock, u32 GroupType) 1342{ 1355 1356void SKG_RemoveSocket(GF_SocketGroup *group, GF_Socket *sock, u32 GroupType) 1357{ 1370 1371Bool SKG_IsSocketIN(GF_SocketGroup *group, GF_Socket *sock, u32 GroupType) 1372{inet.erl https://github.com/system/erlang-otp.git | Erlang | 1,352 lines
195 196-spec(close/1 :: (Socket :: socket()) -> 'ok'). 197 230-spec(setsockname/2 :: ( 231 Socket :: socket(), 232 Address :: {ip_address(), ip_port()}) -> 474 475-spec(getll/1 :: (Socket :: socket()) -> 476 {'ok', socket()}). 477 478getll(Socket) when is_port(Socket) -> 479 {ok, Socket}. 484 485-spec(getfd/1 :: (Socket :: socket()) -> 486 {'ok', non_neg_integer()} | {'error', posix()}).http_socket.test.php https://github.com/mariuz/firetube.git | PHP | 1,407 lines
167/** 168 * Tests that HttpSocket::request (the heart of the HttpSocket) is working properly. 169 * 780 781 $r = $this->Socket->buildRequestLine(array('method' => 'GET', 'uri' => 'http://www.cakephp.org/search?q=socket')); 782 $this->assertIdentical($r, "GET /search?q=socket HTTP/1.1\r\n"); 983 984 $r = $this->Socket->buildUri(array('host' => 'www.cakephp.org', 'path' => '/search', 'query' => array('q' => 'HttpSocket'))); 985 $this->assertIdentical($r, 'http://www.cakephp.org/search?q=HttpSocket'); 1355/** 1356 * This tests asserts HttpSocket::reset() resets a HttpSocket instance to it's initial state (before Object::__construct 1357 * got executed) 1378/** 1379 * This tests asserts HttpSocket::reset(false) resets certain HttpSocket properties to their initial state (before 1380 * Object::__construct got executed).NIOSocket.java https://github.com/zootella/learning.git | Java | 1,031 lines
30 * 31 * NIOSocket extends Socket, meaning that it is a socket. 32 * However, we never use that socket. 147 148 // Save the Socket and SocketChannel objects for this connection in this NIOSocket object 149 channel = s.getChannel(); // Get the NIOSocketChannel object associated with the given connection java.net.Socket object 172 // Make a new pair of Socket and SocketChannel objects 173 channel = SocketChannel.open(); // Call the static method java.nio.channels.SocketChannel.open() to make a new SocketChannel object 174 socket = channel.socket(); // Get the java.net.Socket object that it goes with 726 /* 727 * LimeWire's NIOSocket class extends Socket, so it is a socket. 728 * It also has a member object of type Socket named socket, so it contains a socket. 730 * 731 * NIOSocket never uses the socket that it is, and only uses the socket that it contains instead. 732 * This class extends Socket just to steal its interface.Socket.h https://github.com/Canno/mangos.git | C Header | 739 lines
75 Socket *GetSocket() const { return m_socket; } 76 SocketThread(const SocketThread& s) : m_socket(s.GetSocket()) {} 77 SocketThread& operator=(const SocketThread& ) { return *this; } 138 /** "Default" constructor */ 139 Socket(ISocketHandler&); 140 679private: 680 ISocketHandler& m_handler; ///< Reference of ISocketHandler in control of this socket 681 SOCKET m_socket; ///< File descriptor 684 time_t m_tCreate; ///< Time in seconds when this socket was created 685 Socket *m_parent; ///< Pointer to ListenSocket class, valid for incoming sockets 686 bool m_b_disable_read; ///< Disable checking for read events 711#ifdef ENABLE_POOL 712 int m_socket_type; ///< Type of socket, from socket() call 713 std::string m_socket_protocol; ///< Protocol, from socket() calltest_mem_cache.rb https://github.com/mnutt/hydraproject.git | Ruby | 744 lines
15 16class FakeSocket 17 46 @port = 11211 47 @socket = socket || FakeSocket.new 48 end 107 def test_cache_get_miss 108 socket = FakeSocket.new 109 socket.data.write "END\r\n" 656 def test_flush_all_failure 657 socket = FakeSocket.new 658 socket.data.write "ERROR\r\n" 674 def test_stats 675 socket = FakeSocket.new 676 socket.data.write "STAT pid 20188\r\nSTAT total_items 32\r\nSTAT version 1.2.3\r\nSTAT rusage_user 1:300\r\nSTAT dummy ok\r\nEND\r\n"test_mem_cache.rb https://github.com/ryland/memcache-client.git | Ruby | 758 lines
15 16class FakeSocket 17 46 @port = 11211 47 @socket = socket || FakeSocket.new 48 end 107 def test_cache_get_miss 108 socket = FakeSocket.new 109 socket.data.write "END\r\n" 670 def test_flush_all_failure 671 socket = FakeSocket.new 672 socket.data.write "ERROR\r\n" 688 def test_stats 689 socket = FakeSocket.new 690 socket.data.write "STAT pid 20188\r\nSTAT total_items 32\r\nSTAT version 1.2.3\r\nSTAT rusage_user 1:300\r\nSTAT dummy ok\r\nEND\r\n"http_socket.test.php https://github.com/yjcqwliu/xuanjianghui.git | PHP | 1,313 lines
164/** 165 * Tests that HttpSocket::request (the heart of the HttpSocket) is working properly. 166 * 725 726 $r = $this->Socket->buildRequestLine(array('method' => 'GET', 'uri' => 'http://www.cakephp.org/search?q=socket')); 727 $this->assertIdentical($r, "GET /search?q=socket HTTP/1.1\r\n"); 901 902 $r = $this->Socket->buildUri(array('host' => 'www.cakephp.org', 'path' => '/search', 'query' => array('q' => 'HttpSocket'))); 903 $this->assertIdentical($r, 'http://www.cakephp.org/search?q=HttpSocket'); 1263/** 1264 * This tests asserts HttpSocket::reset() resets a HttpSocket instance to it's initial state (before Object::__construct 1265 * got executed) 1285/** 1286 * This tests asserts HttpSocket::reset(false) resets certain HttpSocket properties to their initial state (before 1287 * Object::__construct got executed).IoSocket.c https://github.com/qxjit/io.git | C | 597 lines
140 141IoSocket *IoSocket_newWithSocket_(void *state, Socket *socket) 142{ 222 223 if (Socket_streamOpen(socket) && Socket_isOpen(socket) && Socket_makeReusable(socket) && Socket_makeAsync(socket)) 224 { 239 240 if (Socket_udpOpen(socket) && Socket_isOpen(socket) && Socket_makeReusable(socket) && Socket_makeAsync(socket)) 241 { 334 IPAddress *address = IoMessage_locals_rawIPAddressArgAt_(m, locals, 0); 335 Socket *socket = Socket_accept(SOCKET(self), address); 336 338 { 339 IoObject *newSocket = IoSocket_newWithSocket_(IOSTATE, socket); 340 newSocket = IoObject_initClone_(self, locals, m, newSocket);lm-old-socket.c https://github.com/engineyard/loudmouth.git | C | 1,062 lines
93 94static void socket_free (LmOldSocket *socket); 95static gboolean socket_do_connect (LmConnectData *connect_data); 144static gint 145old_socket_do_write (LmOldSocket *socket, const gchar *buf, guint len) 146{ 1034void 1035lm_old_socket_asyncns_cancel (LmOldSocket *socket) 1036{ 1044gboolean 1045lm_old_socket_get_use_starttls (LmOldSocket *socket) 1046{ 1054gboolean 1055lm_old_socket_get_require_starttls (LmOldSocket *socket) 1056{http_socket.test.php https://github.com/MrRio/wildflower.git | PHP | 1,311 lines
162/** 163 * Tests that HttpSocket::request (the heart of the HttpSocket) is working properly. 164 * 723 724 $r = $this->Socket->buildRequestLine(array('method' => 'GET', 'uri' => 'http://www.cakephp.org/search?q=socket')); 725 $this->assertIdentical($r, "GET /search?q=socket HTTP/1.1\r\n"); 899 900 $r = $this->Socket->buildUri(array('host' => 'www.cakephp.org', 'path' => '/search', 'query' => array('q' => 'HttpSocket'))); 901 $this->assertIdentical($r, 'http://www.cakephp.org/search?q=HttpSocket'); 1261/** 1262 * This tests asserts HttpSocket::reset() resets a HttpSocket instance to it's initial state (before Object::__construct 1263 * got executed) 1283/** 1284 * This tests asserts HttpSocket::reset(false) resets certain HttpSocket properties to their initial state (before 1285 * Object::__construct got executed).postgresql-socket-api.lisp https://github.com/UnwashedMeme/clsql.git | Lisp | 973 lines
415 :defaults host)))) 416 (socket:make-socket :type :stream :address-family :file 417 :connect :active 608 (let ((socket (postgresql-connection-socket connection))) 609 (and socket (streamp socket) (open-stream-p socket)))) 610 940 (#.+completed-response-message+ 941 (return (values nil (read-socket-value-string socket)))) 942 (#.+error-response-message+ 942 (#.+error-response-message+ 943 (let ((message (read-socket-value-string socket))) 944 (error 'postgresql-error 946 (#.+notice-response-message+ 947 (let ((message (read-socket-value-string socket))) 948 (warn 'postgresql-warningtest_mem_cache.rb https://github.com/xb/memcache-client.git | Ruby | 950 lines
22 23class FakeSocket 24 87 @port = 11211 88 @socket = socket || FakeSocket.new 89 @weight = 1 278 def test_cache_get_miss 279 socket = FakeSocket.new 280 socket.data.write "END\r\n" 839 def test_flush_all_failure 840 socket = FakeSocket.new 841 858 def test_stats 859 socket = FakeSocket.new 860 socket.data.write "STAT pid 20188\r\nSTAT total_items 32\r\nSTAT version 1.2.3\r\nSTAT rusage_user 1:300\r\nSTAT dummy ok\r\nEND\r\n"test_mem_cache.rb https://github.com/delamonpansie/memcache-client.git | Ruby | 1,251 lines
23 24class FakeSocket 25 88 @port = 11211 89 @socket = socket || FakeSocket.new 90 @weight = 1 294 def test_cache_get_miss 295 socket = FakeSocket.new 296 socket.data.write "END\r\n" 1077 def test_flush_all_failure 1078 socket = FakeSocket.new 1079 1108 def test_stats 1109 socket = FakeSocket.new 1110 socket.data.write "STAT pid 20188\r\nSTAT total_items 32\r\nSTAT version 1.2.3\r\nSTAT rusage_user 1:300\r\nSTAT dummy ok\r\nEND\r\n"index.html https://github.com/richcollins/io.git | HTML | 526 lines
201</div> 202<a name="Socket-getSocketReadLowWaterMark"></a><b> 203getSocketReadLowWaterMark 397</div> 398<a name="Socket-setSocketWriteBufferSize"></a><b> 399setSocketWriteBufferSize(numberOfBytes) 404</div> 405<a name="Socket-setSocketWriteLowWaterMark"></a><b> 406setSocketWriteLowWaterMark(numberOfBytes) 430<div class=slotDescription> 431Reads numberOfBytes from the socket into the socket's readBuffer. 432 Returns self when all bytes are read or an Error object on error. 494<div class=slotDescription> 495Writes the contents of the socket's writeBuffer to the socket. 496 If optionalProgressBlock is supplied, it is periodically called with the number of bytes written as an argument.IoSocket.c https://github.com/richcollins/io.git | C | 598 lines
141 142IoSocket *IoSocket_newWithSocket_(void *state, Socket *socket) 143{ 223 224 if (Socket_streamOpen(socket) && Socket_isOpen(socket) && Socket_makeReusable(socket) && Socket_makeAsync(socket)) 225 { 240 241 if (Socket_udpOpen(socket) && Socket_isOpen(socket) && Socket_makeReusable(socket) && Socket_makeAsync(socket)) 242 { 335 IPAddress *address = IoMessage_locals_rawIPAddressArgAt_(m, locals, 0); 336 Socket *socket = Socket_accept(SOCKET(self), address); 337 339 { 340 IoObject *newSocket = IoSocket_newWithSocket_(IOSTATE, socket); 341 newSocket = IoObject_initClone_(self, locals, m, newSocket);test_mem_cache.rb https://github.com/bcg/memcache-client.git | Ruby | 989 lines
22 23class FakeSocket 24 87 @port = 11211 88 @socket = socket || FakeSocket.new 89 @weight = 1 278 def test_cache_get_miss 279 socket = FakeSocket.new 280 socket.data.write "END\r\n" 878 def test_flush_all_failure 879 socket = FakeSocket.new 880 897 def test_stats 898 socket = FakeSocket.new 899 socket.data.write "STAT pid 20188\r\nSTAT total_items 32\r\nSTAT version 1.2.3\r\nSTAT rusage_user 1:300\r\nSTAT dummy ok\r\nEND\r\n"test_mem_cache_db.rb https://github.com/KellyMahan/memcachedb-client.git | Ruby | 1,012 lines
23 24class FakeSocketDb 25 88 @port = 21201 89 @socket = socket || FakeSocketDb.new 90 @weight = 1 279 def test_cache_get_miss 280 socket = FakeSocketDb.new 281 socket.data.write "END\r\n" 868 def test_flush_all_failure 869 socket = FakeSocketDb.new 870 887 def test_stats 888 socket = FakeSocketDb.new 889 socket.data.write "STAT pid 20188\r\nSTAT total_items 32\r\nSTAT version 1.2.3\r\nSTAT rusage_user 1:300\r\nSTAT dummy ok\r\nEND\r\n"principe_test.erl https://github.com/yrashk/medici.git | Erlang | 240 lines
34put_get_test(ConnectParams) -> 35 {ok, Socket} = principe:connect(ConnectParams), 36 ok = principe:put(Socket, "put_get1", "testval"), 36 ok = principe:put(Socket, "put_get1", "testval"), 37 ok = principe:put(Socket, <<"put_get2">>, <<32,145,56,0,14>>), 38 <<"testval">> = principe:get(Socket, <<"put_get1">>), 38 <<"testval">> = principe:get(Socket, <<"put_get1">>), 39 <<32, 145, 56, 0, 14>> = principe:get(Socket, "put_get2"), 40 case proplists:get_value(bigend, principe:stat(Socket)) of 41 "0" -> 42 ok = principe:put(Socket, <<"put_get3">>, 42, little), 43 <<42:32/little>> = principe:get(Socket, <<"put_get3">>); 44 "1" -> 45 ok = principe:put(Socket, <<"put_get3">>, 42, big), 46 <<42:32>> = principe:get(Socket, <<"put_get3">>)principe.erl https://github.com/yrashk/medici.git | Erlang | 852 lines
114%% Macros for function patterns that are used frequently. 115-define(T0(Code), gen_tcp:send(Socket, [<<Code:16>>])). 116-define(T1(Code), gen_tcp:send(Socket, [<<Code:16>>, <<(iolist_size(Key)):32>>, Key])). 116-define(T1(Code), gen_tcp:send(Socket, [<<Code:16>>, <<(iolist_size(Key)):32>>, Key])). 117-define(T2(Code), gen_tcp:send(Socket, [<<Code:16>>, <<(iolist_size(Key)):32>>, <<(iolist_size(Value)):32>>, Key, Value])). 118-define(R_SUCCESS, tyrant_response(Socket, fun recv_success/2)). 118-define(R_SUCCESS, tyrant_response(Socket, fun recv_success/2)). 119-define(R_INT32, tyrant_response(Socket, fun recv_size/2)). 120-define(R_SIZE_DATA, tyrant_response(Socket, fun recv_size_data/2)). 120-define(R_SIZE_DATA, tyrant_response(Socket, fun recv_size_data/2)). 121-define(R_INT64, tyrant_response(Socket, fun recv_size64/2)). 122 139%% ConnectProps proplist to determine the hostname, port number and tcp 140%% socket options for the connection. Any missing parameters are filled 141%% in using the module defaults.