Home
last modified time | relevance | path

Searched refs:sock (Results 1 - 25 of 52) sorted by relevance

123

/Couchbase_C_Client_v3.0/tests/socktests/
H A Dt_basic.cc29 ESocket sock; in TEST_F() local
32 loop->connect(&sock); in TEST_F()
33 ASSERT_FALSE(sock.sock == NULL); in TEST_F()
34 ASSERT_TRUE(sock.creq == NULL); in TEST_F()
35 ASSERT_EQ(1, sock.sock->refcount); in TEST_F()
42 sock.conn->setRecv(&rf); in TEST_F()
43 sock.put(sendStr); in TEST_F()
44 sock in TEST_F()
83 ESocket sock; TEST_F() local
94 ESocket sock; TEST_F() local
104 ESocket sock; TEST_F() local
114 ESocket sock; TEST_F() local
124 ESocket sock; TEST_F() local
137 conncb_1(lcbio_SOCKET *sock, void *arg, lcb_STATUS err, lcbio_OSERR syserr) conncb_1() argument
151 ESocket sock; TEST_F() local
[all...]
H A Dt_read.cc17 ESocket sock; in TEST_F() local
18 loop->connect(&sock); in TEST_F()
22 ReadBreakCondition cond(&sock, expected.size()); in TEST_F()
24 sock.reqrd(expected.size() * 2); in TEST_F()
25 sock.schedule(); in TEST_F()
26 sock.conn->setSend(&sf); in TEST_F()
33 ASSERT_TRUE(sock.getReceived().empty()); in TEST_F()
36 sock.conn->setSend(&sf2); in TEST_F()
37 cond = ReadBreakCondition(&sock, expected.size() * 2); in TEST_F()
42 ASSERT_FALSE(sock in TEST_F()
49 ESocket sock; TEST_F() local
68 ESocket sock; TEST_F() local
83 ESocket sock; TEST_F() local
110 ESocket sock; TEST_F() local
174 ESocket sock; TEST_F() local
[all...]
H A Dt_write.cc15 ESocket sock; in TEST_F() local
16 loop->connect(&sock); in TEST_F()
22 sock.put("Hello "); in TEST_F()
23 sock.schedule(); in TEST_F()
24 sock.put("World"); in TEST_F()
25 sock.schedule(); in TEST_F()
26 sock.put("!"); in TEST_F()
27 sock.schedule(); in TEST_F()
28 sock.schedule(); in TEST_F()
30 sock in TEST_F()
44 ESocket sock; TEST_F() local
67 ESocket sock; TEST_F() local
84 ESocket sock; TEST_F() local
[all...]
H A Dt_ctx.cc19 ESocket sock; in TEST_F() local
21 loop->connect(&sock); in TEST_F()
23 sock.put("Hi"); in TEST_F()
24 sock.schedule(); in TEST_F()
27 CtxCloseBreakCondition cbc(&sock); in TEST_F()
34 lcbio_SOCKET *sock; member
38 sock = NULL; in ReleaseInfo()
43 sock = NULL; in reset()
53 info->sock = s; in release_cb()
62 ESocket sock; in TEST_F() local
[all...]
H A Dt_ssl.cc55 ESocket sock; in TEST_F() local
58 loop->connect(&sock); in TEST_F()
59 ASSERT_FALSE(sock.sock == nullptr); in TEST_F()
60 ASSERT_TRUE(sock.creq == nullptr); in TEST_F()
61 ASSERT_EQ(1, sock.sock->refcount); in TEST_F()
68 sock.conn->setRecv(&rf); in TEST_F()
69 sock.put(sendStr); in TEST_F()
70 sock in TEST_F()
[all...]
H A Dt_reentrant.cc62 ESocket sock; in TEST_F() local
63 loop->connect(&sock); in TEST_F()
65 sock.conn->setSend(&sf1); in TEST_F()
66 sock.reqrd(100); in TEST_F()
67 sock.schedule(); in TEST_F()
71 sock.setActions(&raa); in TEST_F()
75 ASSERT_TRUE(sock.getUnreadSize() >= 200); in TEST_F()
118 ESocket sock; in TEST_F() local
119 loop->connect(&sock); in TEST_F()
121 sock in TEST_F()
157 ESocket sock; TEST_F() local
[all...]
H A Dsocktest.cc38 static void conn_cb(lcbio_SOCKET *sock, void *data, lcb_STATUS err, lcbio_OSERR oserr) in conn_cb() argument
41 mysock->assign(sock, err); in conn_cb()
97 sock = s; in assign()
118 if (lcb::io::Pool::is_from_pool(ctx->sock)) { in close()
124 sock = NULL; in close()
205 void Loop::initSockCommon(ESocket *sock) in initSockCommon() argument
208 struct sockaddr_in *addr = (struct sockaddr_in *)&sock->sock->info->sa_local; in initSockCommon()
210 sock->conn = server->findConnection(port); in initSockCommon()
213 void Loop::connectPooled(ESocket *sock, lcb_host_ argument
228 connect(ESocket *sock, lcb_host_t *host, unsigned mstmo) connect() argument
[all...]
H A Dt_putex.cc163 ESocket sock; member in SockPutexTest
169 sock.setActions(&bufActions); in SetUp()
170 loop->connect(&sock); in SetUp()
175 sock.close(); in TearDown()
187 sock.conn->setRecv(&rf); in TEST_F()
188 lcbio_ctx_wwant(sock.ctx); in TEST_F()
189 sock.schedule(); in TEST_F()
219 sock.conn->setRecv(&rf); in TEST_F()
226 lcbio_ctx_wwant(sock.ctx); in TEST_F()
227 sock in TEST_F()
250 TClosedBreakCondition(ESocket *sock, BufList *buflist) TClosedBreakCondition() argument
[all...]
H A Dsocktest.h109 lcbio_SOCKET *sock; member
136 sock = NULL; in ESocket()
215 void assign(lcbio_SOCKET *sock, lcb_STATUS err);
331 sock = s; in FlushedBreakCondition()
339 ESocket *sock; member in FlushedBreakCondition
355 sock = s; in ReadBreakCondition()
365 ESocket *sock; member in ReadBreakCondition
381 sock = s; in ErrorBreakCondition()
385 ESocket *sock; member in ErrorBreakCondition
388 return sock in shouldBreakImpl()
397 CtxCloseBreakCondition(ESocket *sock) CtxCloseBreakCondition() argument
[all...]
H A Dt_manager.cc20 lcbio_SOCKET *rawsock = sock1->sock; in TEST_F()
24 ASSERT_EQ(rawsock, sock2->sock); in TEST_F()
28 ASSERT_NE(rawsock, sock3->sock); in TEST_F()
53 llfd = sock1->ctx->sock->u.fd; in TEST_F()
55 llfd = sock1->ctx->sock->u.sd->socket; in TEST_F()
130 lcbio_protoctx_add(s->sock, pctx); in TEST_F()
157 ASSERT_TRUE(s->sock != NULL); in TEST_F()
/Couchbase_C_Client_v3.0/src/lcbio/
H A Dconnect.cc46 #define CSLOGID(sock) \
47 sock->settings->log_redaction ? LCB_LOG_SD_OTAG : "", get_loghost(sock)->ipv6 ? "[" : "", get_loghost(sock)->host, \
48 get_loghost(sock)->ipv6 ? "]" : "", get_loghost(sock)->port, \
49 sock->settings->log_redaction ? LCB_LOG_SD_CTAG : "", sock->id
52 #define LOGARGS_T(lvl) LOGARGS(this->sock, lvl)
53 #define CSLOGID_T() CSLOGID(this->sock)
79 lcbio_SOCKET *sock; global() member
102 try_enable_sockopt(lcbio_SOCKET *sock, int cntl) try_enable_sockopt() argument
385 C_conncb(lcb_sockdata_t *sock, int status) C_conncb() argument
[all...]
H A Dioutils.cc170 static void lcbio_cache_local_name(lcbio_CONNINFO *sock) in lcbio_cache_local_name() argument
173 switch (sock->sa_local.ss_family) { in lcbio_cache_local_name()
175 auto *addr = (struct sockaddr_in *)&sock->sa_local; in lcbio_cache_local_name()
177 strncpy(sock->ep_local.host, addr_str, sizeof(sock->ep_local.host)); in lcbio_cache_local_name()
178 snprintf(sock->ep_local.port, sizeof(sock->ep_local.port), "%d", (int)ntohs(addr->sin_port)); in lcbio_cache_local_name()
182 auto *addr = (struct sockaddr_in6 *)&sock->sa_local; in lcbio_cache_local_name()
184 strncpy(sock->ep_local.host, addr_str, sizeof(sock in lcbio_cache_local_name()
192 lcbio__load_socknames(lcbio_SOCKET *sock) lcbio__load_socknames() argument
238 lcbio_get_nameinfo(lcbio_SOCKET *sock, struct lcbio_NAMEINFO *nistrs) lcbio_get_nameinfo() argument
259 lcbio_is_netclosed(lcbio_SOCKET *sock, int flags) lcbio_is_netclosed() argument
[all...]
H A Dmanager.cc102 inline void on_connected(lcbio_SOCKET *sock, lcb_STATUS err);
116 static PoolConnInfo *from_sock(lcbio_SOCKET *sock) in from_sock()
118 lcbio_PROTOCTX *ctx = lcbio_protoctx_get(sock, LCBIO_PROTOCTX_POOL); in from_sock()
123 lcbio_SOCKET *sock; member
141 : host(host_), callback(cb), arg(cbarg), timer(host->parent->io, this), state(PENDING), sock(nullptr), in PoolRequest()
159 sock = cinfo->sock; in set_ready()
181 lcbio_SOCKET *sock; member
212 if (sock) { in ~PoolConnInfo()
215 lcbio_protoctx_delptr(sock, thi in ~PoolConnInfo()
359 on_connected(lcbio_SOCKET *sock, void *arg, lcb_STATUS err, lcbio_OSERR) on_connected() argument
535 put(lcbio_SOCKET *sock) put() argument
561 discard(lcbio_SOCKET *sock) discard() argument
566 detach(lcbio_SOCKET *sock) detach() argument
571 is_from_pool(const lcbio_SOCKET *sock) is_from_pool() argument
[all...]
H A Dctx.cc29 if (ctx->sock && ctx->sock->metrics) { \
30 ctx->sock->metrics->metric += n; \
34 #define LOGARGS(c, lvl) (c)->sock->settings, "ioctx", LCB_LOG_##lvl, __FILE__, __LINE__
48 const lcb_settings *settings = ctx->sock->settings; in convert_lcberr()
49 lcbio_OSERR oserr = IOT_ERRNO(ctx->sock->io); in convert_lcberr()
51 if (lcbio_ssl_check(ctx->sock)) { in convert_lcberr()
52 lcb_STATUS err = lcbio_ssl_get_error(ctx->sock); in convert_lcberr()
67 lcbio_CTX *lcbio_ctx_new(lcbio_SOCKET *sock, void *data, const lcbio_CTXPROCS *procs) in lcbio_ctx_new() argument
70 ctx->sock in lcbio_ctx_new()
265 E_handler(lcb_socket_t sock, short which, void *arg) E_handler() argument
[all...]
H A Dprotoctx.cc20 void lcbio_protoctx_add(lcbio_SOCKET *sock, lcbio_PROTOCTX *ctx) in lcbio_protoctx_add() argument
22 lcb_list_append(&sock->protos, &ctx->ll); in lcbio_protoctx_add()
25 lcbio_PROTOCTX *lcbio_protoctx_get(const lcbio_SOCKET *sock, lcbio_PROTOID id) in lcbio_protoctx_get() argument
28 LCB_LIST_FOR(ll, &sock->protos) in lcbio_protoctx_get()
40 static lcbio_PROTOCTX *del_common(lcbio_SOCKET *sock, int mode, lcbio_PROTOID id, lcbio_PROTOCTX *ctx, int dtor) in del_common() argument
43 LCB_LIST_SAFE_FOR(ll, next, &sock->protos) in del_common()
H A Dssl.h95 * @param sock The socket to which SSL should be applied
99 lcb_STATUS lcbio_ssl_apply(lcbio_SOCKET *sock, lcbio_pSSLCTX sctx);
103 * @param sock The socket to check
107 int lcbio_ssl_check(lcbio_SOCKET *sock);
113 * @param sock
118 lcb_STATUS lcbio_ssl_get_error(lcbio_SOCKET *sock);
138 * @param sock The socket to SSLify
143 lcb_STATUS lcbio_sslify_if_needed(lcbio_SOCKET *sock, struct lcb_settings_st *settings);
H A Dioutils.h83 int lcbio_get_nameinfo(lcbio_SOCKET *sock, struct lcbio_NAMEINFO *nistrs);
86 int lcbio_is_netclosed(lcbio_SOCKET *sock, int flags);
90 * @param sock The socket
94 lcb_STATUS lcbio_enable_sockopt(lcbio_SOCKET *sock, int cntl);
98 void lcbio__load_socknames(lcbio_SOCKET *sock);
H A Dmanager.h115 static void put(lcbio_SOCKET *sock);
122 static void discard(lcbio_SOCKET *sock);
138 static void detach(lcbio_SOCKET *sock);
140 static bool is_from_pool(const lcbio_SOCKET *sock);
/Couchbase_C_Client_v3.0/include/libcouchbase/plugins/io/
H A Dbsdio-inl.c34 static int get_wserr(lcb_socket_t sock) in get_wserr() argument
41 getsockopt(sock, SOL_SOCKET, SO_ERROR, (char *)&ext, &len); in get_wserr()
45 static lcb_ssize_t recvv_impl(lcb_io_opt_t iops, lcb_socket_t sock, struct lcb_iovec_st *iov, lcb_size_t niov) in recvv_impl() argument
50 if (WSARecv(sock, bufptr, niov, &nr, &flags, NULL, NULL) == SOCKET_ERROR) { in recvv_impl()
51 LCB_IOPS_ERRNO(iops) = get_wserr(sock); in recvv_impl()
62 static lcb_ssize_t recv_impl(lcb_io_opt_t iops, lcb_socket_t sock, void *buf, lcb_size_t nbuf, int fl_unused) in recv_impl() argument
68 return recvv_impl(iops, sock, (struct lcb_iovec_st *)&iov, 1); in recv_impl()
71 static lcb_ssize_t sendv_impl(lcb_io_opt_t iops, lcb_socket_t sock, struct lcb_iovec_st *iov, lcb_size_t niov) in sendv_impl() argument
75 if (WSASend(sock, bufptr, niov, &nw, fl, NULL, NULL) == SOCKET_ERROR) { in sendv_impl()
76 LCB_IOPS_ERRNO(iops) = get_wserr(sock); in sendv_impl()
82 send_impl(lcb_io_opt_t iops, lcb_socket_t sock, const void *buf, lcb_size_t nbuf, int flags) send_impl() argument
92 recvv_impl(lcb_io_opt_t iops, lcb_socket_t sock, struct lcb_iovec_st *iov, lcb_size_t niov) recvv_impl() argument
107 recv_impl(lcb_io_opt_t iops, lcb_socket_t sock, void *buf, lcb_size_t nbuf, int flags) recv_impl() argument
116 sendv_impl(lcb_io_opt_t iops, lcb_socket_t sock, struct lcb_iovec_st *iov, lcb_size_t niov) sendv_impl() argument
131 send_impl(lcb_io_opt_t iops, lcb_socket_t sock, const void *buf, lcb_size_t nbuf, int flags) send_impl() argument
142 make_socket_nonblocking(lcb_socket_t sock) make_socket_nonblocking() argument
166 lcb_socket_t sock; socket_impl() local
188 close_impl(lcb_io_opt_t iops, lcb_socket_t sock) close_impl() argument
198 connect_impl(lcb_io_opt_t iops, lcb_socket_t sock, const struct sockaddr *name, unsigned int namelen) connect_impl() argument
218 chkclosed_impl(lcb_io_opt_t iops, lcb_socket_t sock, int flags) chkclosed_impl() argument
261 cntl_getset_impl(lcb_io_opt_t io, lcb_socket_t sock, int mode, int oslevel, int osopt, int optsize, void *optval) cntl_getset_impl() argument
290 cntl_impl(lcb_io_opt_t io, lcb_socket_t sock, int mode, int option, void *arg) cntl_impl() argument
[all...]
/Couchbase_C_Client_v3.0/plugins/io/libuv/
H A Dplugin-libuv.c21 static my_uvreq_t *alloc_uvreq(my_sockdata_t *sock, generic_callback_t callback);
178 static void sock_dump_pending(my_sockdata_t *sock) in sock_dump_pending() argument
180 printf("Socket %p:\n", (void *)sock); in sock_dump_pending()
181 printf("\tRead: %d\n", sock->pending.read); in sock_dump_pending()
182 printf("\tWrite: %d\n", sock->pending.write); in sock_dump_pending()
186 static void sock_do_uv_close(my_sockdata_t *sock) in sock_do_uv_close() argument
188 if (!sock->uv_close_called) { in sock_do_uv_close()
189 sock->uv_close_called = 1; in sock_do_uv_close()
190 uv_close((uv_handle_t *)&sock->tcp, socket_closed_callback); in sock_do_uv_close()
194 static void decref_sock(my_sockdata_t *sock) in decref_sock() argument
241 my_sockdata_t *sock = PTR_FROM_FIELD(my_sockdata_t, handle, tcp); socket_closed_callback() local
256 my_sockdata_t *sock = (my_sockdata_t *)sockbase; close_socket() local
308 my_sockdata_t *sock = (my_sockdata_t *)sockbase; start_connect() local
365 my_sockdata_t *sock = mw->sock; write2_callback() local
424 my_sockdata_t *sock = PTR_FROM_FIELD(my_sockdata_t, handle, tcp); UVC_ALLOC_CB() local
437 my_sockdata_t *sock = PTR_FROM_FIELD(my_sockdata_t, mt, tcp); UVC_READ_CB() local
472 my_sockdata_t *sock = (my_sockdata_t *)sockbase; start_read() local
492 my_sockdata_t *sock = (my_sockdata_t *)sockbase; get_nameinfo() local
567 alloc_uvreq(my_sockdata_t *sock, generic_callback_t callback) alloc_uvreq() argument
591 lcb_socket_t sock = sd->base.socket; check_closed() local
[all...]
/Couchbase_C_Client_v3.0/src/
H A Dctx-log-inl.h25 if (!ctx->sock) { in get_ctx_host()
28 if (!ctx->sock->info) { in get_ctx_host()
31 return &ctx->sock->info->ep_remote; in get_ctx_host()
37 (ctx && ctx->sock && ctx->sock->settings->log_redaction) ? LCB_LOG_SD_OTAG : "", \
39 get_ctx_host(ctx)->port, (ctx && ctx->sock && ctx->sock->settings->log_redaction) ? LCB_LOG_SD_CTAG : "", \
/Couchbase_C_Client_v3.0/tests/mocksupport/
H A Dserver.c54 info->sock = -1;
73 if ((info->sock = socket(next->ai_family, next->ai_socktype, next->ai_protocol)) == -1) {
77 setsockopt(info->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags));
79 if (bind(info->sock, next->ai_addr, next->ai_addrlen) == -1) {
80 closesocket(info->sock);
81 info->sock = -1;
83 } else if (listen(info->sock, 10) == -1) {
84 closesocket(info->sock);
85 info->sock = -1;
91 if (getsockname(info->sock, (struc
110 int sock = -1; global() local
[all...]
/Couchbase_C_Client_v3.0/src/ssl/
H A Dssl_common.c80 static int Eis_closed(lcb_io_opt_t io, lcb_socket_t sock, int flags) in Eis_closed() argument
83 return xs->orig->u_io.v0.io.is_closed(IOT_ARG(xs->orig), sock, flags); in Eis_closed()
223 lcbio_SOCKET *sock = SSL_get_app_data(ssl); in log_callback() local
240 lcb_log(LOGARGS(ssl, LCB_LOG_TRACE), "<%s:%s> sock=%p: ST(0x%x). %s. R(0x%x) %s (%s)", in log_callback()
241 sock->info ? sock->info->ep_remote.host : "", sock->info ? sock->info->ep_remote.port : "", (void *)sock, in log_callback()
245 lcb_log(LOGARGS(ssl, LCB_LOG_DEBUG), "sock in log_callback()
430 lcbio_ssl_apply(lcbio_SOCKET *sock, lcbio_pSSLCTX sctx) lcbio_ssl_apply() argument
457 lcbio_ssl_check(lcbio_SOCKET *sock) lcbio_ssl_check() argument
462 lcbio_ssl_get_error(lcbio_SOCKET *sock) lcbio_ssl_get_error() argument
562 lcbio_sslify_if_needed(lcbio_SOCKET *sock, lcb_settings *settings) lcbio_sslify_if_needed() argument
[all...]
H A Dssl_e.c302 static int start_watch(lcb_io_opt_t iops, lcb_socket_t sock, void *event, short which, void *uarg, in start_watch() argument
313 (void)sock; in start_watch()
318 static void stop_watch(lcb_io_opt_t iops, lcb_socket_t sock, void *event) in stop_watch() argument
320 start_watch(iops, sock, event, 0, NULL, NULL); in stop_watch()
324 static lcb_ssize_t Essl_recv(lcb_io_opt_t iops, lcb_socket_t sock, void *buf, lcb_size_t nbuf, int ign) in Essl_recv() argument
345 (void)sock; in Essl_recv()
349 static lcb_ssize_t Essl_send(lcb_io_opt_t iops, lcb_socket_t sock, const void *buf, lcb_size_t nbuf, int ign) in Essl_send() argument
354 (void)sock; in Essl_send()
375 static lcb_ssize_t Essl_recvv(lcb_io_opt_t iops, lcb_socket_t sock, lcb_IOV *iov, lcb_size_t niov) in Essl_recvv() argument
378 return Essl_recv(iops, sock, io in Essl_recvv()
381 Essl_sendv(lcb_io_opt_t iops, lcb_socket_t sock, lcb_IOV *iov, lcb_size_t niov) Essl_sendv() argument
[all...]
/Couchbase_C_Client_v3.0/plugins/io/select/
H A Dplugin-select.c31 lcb_socket_t sock; member
77 static int sel_event_update(lcb_io_opt_t iops, lcb_socket_t sock, void *event, short flags, void *cb_data, in sel_event_update() argument
81 ev->sock = sock; in sel_event_update()
97 static void sel_event_cancel(lcb_io_opt_t iops, lcb_socket_t sock, void *event) in sel_event_cancel() argument
104 (void)sock; in sel_event_cancel()
226 FD_SET(ev->sock, &readfds); in run_loop()
230 FD_SET(ev->sock, &writefds); in run_loop()
233 FD_SET(ev->sock, &exceptfds); in run_loop()
234 if (ev->sock > fdma in run_loop()
[all...]

Completed in 55 milliseconds

123