Home
last modified time | relevance | path

Searched refs:socket (Results 1 – 25 of 88) sorted by relevance

1234

/unit/src/
H A Dnxt_conn_read.c17 c->socket.fd, c->socket.read_ready); in nxt_conn_wait()
22 if (c->socket.read_ready) { in nxt_conn_wait()
24 c->socket.task, c, c->socket.data); in nxt_conn_wait()
49 c->socket.fd, c->socket.read_ready, c->socket.closed, in nxt_conn_io_read()
66 if (c->socket.read_ready) { in nxt_conn_io_read()
107 if (c->socket.read_ready) { in nxt_conn_io_read()
157 nxt_debug(c->socket.task, "readv(%d, %ui): %z", c->socket.fd, niov, n); in nxt_conn_io_recvbuf()
168 c->socket.closed = 1; in nxt_conn_io_recvbuf()
187 c->socket.error = err; in nxt_conn_io_recvbuf()
220 c->socket.closed = 1; in nxt_conn_io_recv()
[all …]
H A Dnxt_conn_close.c30 nxt_debug(c->socket.task, "conn close fd:%d, to:%d", in nxt_conn_close()
31 c->socket.fd, c->socket.timedout); in nxt_conn_close()
39 if (c->socket.timedout) { in nxt_conn_close()
61 if (c->socket.error == 0 && !c->socket.closed && !c->socket.shutdown) { in nxt_conn_close()
85 c->socket.shutdown = 1; in nxt_conn_shutdown_handler()
119 nxt_socket_close(task, c->socket.fd); in nxt_conn_close_handler()
120 c->socket.fd = -1; in nxt_conn_close_handler()
149 if (c->socket.fd != -1) { in nxt_conn_close_timer_handler()
150 nxt_socket_close(task, c->socket.fd); in nxt_conn_close_timer_handler()
151 c->socket.fd = -1; in nxt_conn_close_timer_handler()
[all …]
H A Dnxt_linux_sendfile.c113 c->socket.write_ready = 0; in nxt_linux_event_conn_io_sendfile()
120 c->socket.error = err; in nxt_linux_event_conn_io_sendfile()
135 c->socket.write_ready = 0; in nxt_linux_event_conn_io_sendfile()
159 c->socket.write_ready = 0; in nxt_linux_send()
166 c->socket.error = err; in nxt_linux_send()
180 c->socket.write_ready = 0; in nxt_linux_send()
203 n = sendmsg(c->socket.fd, &msg, flags); in nxt_linux_sendmsg()
208 c->socket.fd, niov, flags, n); in nxt_linux_sendmsg()
214 c->socket.write_ready = 0; in nxt_linux_sendmsg()
221 c->socket.error = err; in nxt_linux_sendmsg()
[all …]
H A Dnxt_conn_write.c28 c->socket.fd, c->socket.error, c->block_write); in nxt_conn_io_write()
45 sb.socket = c->socket.fd; in nxt_conn_io_write()
60 c->socket.write_ready = sb.ready; in nxt_conn_io_write()
61 c->socket.error = sb.error; in nxt_conn_io_write()
80 if (!c->socket.write_ready) { in nxt_conn_io_write()
159 c->io->write(task, c, c->socket.data); in nxt_conn_write_timer_handler()
469 nxt_debug(c->socket.task, "writev(%d, %ui): %z", c->socket.fd, niob, n); in nxt_event_conn_io_writev()
481 c->socket.write_ready = 0; in nxt_event_conn_io_writev()
489 c->socket.error = err; in nxt_event_conn_io_writev()
522 c->socket.write_ready = 0; in nxt_event_conn_io_send()
[all …]
H A Dnxt_conn_accept.c46 lev->socket.fd = ls->socket; in nxt_listen_event()
55 lev->socket.log = &nxt_main_log; in nxt_listen_event()
69 lev->socket.task = &lev->task; in nxt_listen_event()
106 c->socket.read_work_queue = lev->socket.read_work_queue; in nxt_conn_accept_alloc()
107 c->socket.write_ready = 1; in nxt_conn_accept_alloc()
168 c->socket.fd = s; in nxt_conn_io_accept()
203 c->socket.data = NULL; in nxt_conn_accept()
292 c->socket.fd, c->socket.read_ready); in nxt_conn_accept_close_idle_handler()
294 if (!c->socket.read_ready) { in nxt_conn_accept_close_idle_handler()
299 c->read_state->close_handler(c->socket.task, c, c->socket.data); in nxt_conn_accept_close_idle_handler()
[all …]
H A Dnxt_aix_send_file.c35 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_aix_event_conn_io_send_file()
56 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_aix_event_conn_io_send_file()
74 nxt_debug(c->socket.task, "send_file(%d) fd:%FD @%O:%O hd:%ui tr:%ui", in nxt_aix_event_conn_io_send_file()
77 n = send_file(&c->socket.fd, &sfp, 0); in nxt_aix_event_conn_io_send_file()
82 nxt_debug(c->socket.task, "send_file(%d): %d sent:%O", in nxt_aix_event_conn_io_send_file()
83 c->socket.fd, n, sent); in nxt_aix_event_conn_io_send_file()
96 c->socket.write_ready = 0; in nxt_aix_event_conn_io_send_file()
103 c->socket.error = err; in nxt_aix_event_conn_io_send_file()
104 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_aix_event_conn_io_send_file()
112 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_aix_event_conn_io_send_file()
[all …]
H A Dnxt_macosx_sendfile.c48 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_macosx_event_conn_io_sendfile()
69 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_macosx_event_conn_io_sendfile()
104 nxt_log_debug(c->socket.log, in nxt_macosx_event_conn_io_sendfile()
106 fb->file->fd, c->socket.fd, fb->file_pos, sent, in nxt_macosx_event_conn_io_sendfile()
109 n = nxt_sys_sendfile(fb->file->fd, c->socket.fd, in nxt_macosx_event_conn_io_sendfile()
120 c->socket.write_ready = 0; in nxt_macosx_event_conn_io_sendfile()
127 c->socket.error = err; in nxt_macosx_event_conn_io_sendfile()
128 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_macosx_event_conn_io_sendfile()
136 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_macosx_event_conn_io_sendfile()
142 nxt_log(c->socket.task, NXT_LOG_ERR, in nxt_macosx_event_conn_io_sendfile()
[all …]
H A Dnxt_freebsd_sendfile.c53 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_freebsd_event_conn_io_sendfile()
73 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_freebsd_event_conn_io_sendfile()
96 fb->file->fd, c->socket.fd, fb->file_pos, file_size, in nxt_freebsd_event_conn_io_sendfile()
100 n = nxt_sys_sendfile(fb->file->fd, c->socket.fd, fb->file_pos, in nxt_freebsd_event_conn_io_sendfile()
105 nxt_debug(c->socket.task, "sendfile(): %d sent:%O", n, sent); in nxt_freebsd_event_conn_io_sendfile()
111 c->socket.write_ready = 0; in nxt_freebsd_event_conn_io_sendfile()
118 c->socket.error = err; in nxt_freebsd_event_conn_io_sendfile()
119 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_freebsd_event_conn_io_sendfile()
127 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_freebsd_event_conn_io_sendfile()
132 nxt_log(c->socket.task, NXT_LOG_ERR, in nxt_freebsd_event_conn_io_sendfile()
[all …]
H A Dnxt_conn_proxy.c85 peer->socket.data = client->socket.data; in nxt_conn_proxy_create()
384 sink->socket.fd, sink->socket.error); in nxt_conn_proxy_read_process()
756 c->socket.closed = 1; in nxt_conn_proxy_read_timeout()
774 c->socket.closed = 1; in nxt_conn_proxy_write_timeout()
809 peer->socket.fd = -1; in nxt_conn_proxy_refused()
832 p = peer->socket.data; in nxt_conn_proxy_reconnect_handler()
858 source->socket.fd, source->socket.closed, source->socket.error); in nxt_conn_proxy_shutdown()
862 sink->socket.fd, sink->socket.closed, sink->socket.error); in nxt_conn_proxy_shutdown()
869 if (sink->socket.error == 0 && !sink->socket.closed) { in nxt_conn_proxy_shutdown()
948 p->client->socket.fd, p->peer->socket.fd); in nxt_conn_proxy_complete()
[all …]
H A Dnxt_hpux_sendfile.c51 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_hpux_event_conn_io_sendfile()
72 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_hpux_event_conn_io_sendfile()
96 nxt_debug(c->socket.task, "sendfile(%d, %FD, @%O, %uz) hd:%ui tr:%ui", in nxt_hpux_event_conn_io_sendfile()
97 c->socket.fd, fb->file->fd, fb->file_pos, file_size, in nxt_hpux_event_conn_io_sendfile()
100 n = nxt_sys_sendfile(c->socket.fd, fb->file->fd, fb->file_pos, in nxt_hpux_event_conn_io_sendfile()
105 nxt_debug(c->socket.task, "sendfile(): %uz", n); in nxt_hpux_event_conn_io_sendfile()
111 c->socket.write_ready = 0; in nxt_hpux_event_conn_io_sendfile()
118 c->socket.error = err; in nxt_hpux_event_conn_io_sendfile()
119 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_hpux_event_conn_io_sendfile()
127 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_hpux_event_conn_io_sendfile()
[all …]
H A Dnxt_conn_connect.c22 c->socket.write_work_queue = c->write_work_queue; in nxt_conn_sys_socket()
49 c->socket.write_ready = 1; in nxt_conn_io_connect()
54 c->socket.write_handler = nxt_conn_connect_test; in nxt_conn_io_connect()
55 c->socket.error_handler = nxt_conn_connect_error; in nxt_conn_io_connect()
61 nxt_fd_event_enable_write(engine, &c->socket); in nxt_conn_io_connect()
104 c->socket.fd = s; in nxt_conn_socket()
106 c->socket.task = task; in nxt_conn_socket()
157 err = c->socket.error; in nxt_conn_connect_error()
192 err = nxt_socket_error(c->socket.fd); in nxt_conn_connect_test_error()
195 c->socket.error = err; in nxt_conn_connect_test_error()
[all …]
H A Dnxt_solaris_sendfilev.c45 nxt_debug(c->socket.task, "sendfilev(%d, %D)", c->socket.fd, nsfv); in nxt_solaris_event_conn_io_sendfilev()
52 n = sendfilev(c->socket.fd, sfv, nsfv, &sent); in nxt_solaris_event_conn_io_sendfilev()
56 nxt_debug(c->socket.task, "sendfilev(): %d sent:%uz", n, sent); in nxt_solaris_event_conn_io_sendfilev()
62 c->socket.write_ready = 0; in nxt_solaris_event_conn_io_sendfilev()
69 c->socket.error = err; in nxt_solaris_event_conn_io_sendfilev()
70 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_solaris_event_conn_io_sendfilev()
71 "sendfilev(%d, %D) failed %E", c->socket.fd, nsfv, err); in nxt_solaris_event_conn_io_sendfilev()
76 nxt_debug(c->socket.task, "sendfilev() %E", err); in nxt_solaris_event_conn_io_sendfilev()
82 c->socket.write_ready = 0; in nxt_solaris_event_conn_io_sendfilev()
H A Dnxt_gnutls.c263 nxt_log_debug(c->socket.log, "gnutls conn init"); in nxt_gnutls_conn_init()
326 nxt_gnutls_conn_handshake(thr, c, c->socket.data); in nxt_gnutls_conn_init()
551 c->socket.fd, buf, size, n); in nxt_gnutls_conn_io_send()
590 if (c->socket.timedout || c->socket.error != 0) { in nxt_gnutls_conn_io_shutdown()
593 } else if (c->socket.closed) { in nxt_gnutls_conn_io_shutdown()
603 c->socket.fd, how, err); in nxt_gnutls_conn_io_shutdown()
619 c->socket.fd); in nxt_gnutls_conn_io_shutdown()
651 c->socket.read_ready = 0; in nxt_gnutls_conn_test_error()
652 c->socket.read_handler = handler; in nxt_gnutls_conn_test_error()
663 c->socket.write_ready = 0; in nxt_gnutls_conn_test_error()
[all …]
H A Dnxt_event_conn_job_sendfile.c32 nxt_fd_event_disable(task->thread->engine, &c->socket); in nxt_event_conn_job_sendfile()
49 nxt_debug(task, "event conn sendfile fd:%d", c->socket.fd); in nxt_event_conn_job_sendfile_start()
58 c->socket.write_handler = nxt_event_conn_job_sendfile_start; in nxt_event_conn_job_sendfile_start()
59 c->socket.error_handler = c->write_state->error_handler; in nxt_event_conn_job_sendfile_start()
78 jbs->job.log = c->socket.log; in nxt_event_conn_job_sendfile_start()
109 first = c->socket.write_ready; in nxt_event_conn_job_sendfile_handler()
142 } while (c->socket.write_ready); in nxt_event_conn_job_sendfile_handler()
212 if (c->socket.error == 0 in nxt_event_conn_job_sendfile_return()
223 task, c, c->socket.data); in nxt_event_conn_job_sendfile_return()
230 if (nxt_slow_path(c->socket.error != 0)) { in nxt_event_conn_job_sendfile_return()
[all …]
H A Dnxt_port_socket.c47 port->socket.task = task; in nxt_port_socket_init()
122 nxt_socket_close(port->socket.task, port->socket.fd); in nxt_port_destroy()
130 port->socket.fd = port->pair[1]; in nxt_port_write_enable()
131 port->socket.log = &nxt_main_log; in nxt_port_write_enable()
132 port->socket.write_ready = 1; in nxt_port_write_enable()
537 } while (port->socket.write_ready); in nxt_port_write_handler()
550 &port->socket); in nxt_port_write_handler()
705 port->socket.fd = port->pair[0]; in nxt_port_read_enable()
706 port->socket.log = &nxt_main_log; in nxt_port_read_enable()
723 port->socket.read_ready = 0; in nxt_port_read_close()
[all …]
H A Dnxt_cyassl.c183 nxt_log_debug(c->socket.log, "cyassl conn init"); in nxt_cyassl_conn_init()
217 nxt_cyassl_conn_handshake(thr, c, c->socket.data); in nxt_cyassl_conn_init()
327 c->socket.fd); in nxt_cyassl_conn_handshake()
416 nxt_log_debug(c->socket.log, "cyassl send"); in nxt_cyassl_conn_io_send()
424 c->socket.error = err; in nxt_cyassl_conn_io_send()
431 c->socket.fd, buf, size, ret); in nxt_cyassl_conn_io_send()
492 c->socket.read_ready = 0; in nxt_cyassl_conn_test_error()
493 c->socket.read_handler = handler; in nxt_cyassl_conn_test_error()
504 c->socket.write_ready = 0; in nxt_cyassl_conn_test_error()
505 c->socket.write_handler = handler; in nxt_cyassl_conn_test_error()
[all …]
H A Dnxt_conn.c55 c->socket.fd = -1; in nxt_conn_create()
57 c->socket.log = &c->log; in nxt_conn_create()
72 c->socket.task = &c->task; in nxt_conn_create()
80 c->socket.read_work_queue = &thr->engine->fast_work_queue; in nxt_conn_create()
81 c->socket.write_work_queue = &thr->engine->fast_work_queue; in nxt_conn_create()
83 nxt_conn_timer_init(&c->read_timer, c, c->socket.read_work_queue); in nxt_conn_create()
84 nxt_conn_timer_init(&c->write_timer, c, c->socket.write_work_queue); in nxt_conn_create()
169 ret = getsockname(c->socket.fd, &sa->u.sockaddr, &socklen); in nxt_conn_local_addr()
171 nxt_alert(task, "getsockname(%d) failed", c->socket.fd); in nxt_conn_local_addr()
H A Dnxt_openssl.c795 nxt_debug(c->socket.task,
1191 ret = SSL_set_fd(s, c->socket.fd);
1253 if (c->socket.error != 0) {
1406 c->socket.write_ready = sb->ready;
1410 sb->ready = c->socket.write_ready;
1413 sb->error = c->socket.error;
1454 if (c->socket.timedout || c->socket.error != 0) {
1559 c->socket.read_ready = 0;
1572 c->socket.write_ready = 0;
1595 c->socket.closed = 1;
[all …]
H A Dnxt_kqueue_engine.c865 c->socket.write_ready = 1; in nxt_kqueue_conn_io_connect()
920 lev->socket.fd, lev->socket.kq_available); in nxt_kqueue_listen_handler()
943 lev->socket.kq_available--; in nxt_kqueue_conn_io_accept()
944 lev->socket.read_ready = (lev->socket.kq_available != 0); in nxt_kqueue_conn_io_accept()
955 c->socket.fd = s; in nxt_kqueue_conn_io_accept()
981 if (c->socket.kq_available == 0 && c->socket.kq_eof) { in nxt_kqueue_conn_io_read()
984 c->socket.closed = 1; in nxt_kqueue_conn_io_read()
1005 if (c->socket.kq_available == 0 && c->socket.kq_eof) { in nxt_kqueue_conn_io_recvbuf()
1006 c->socket.closed = 1; in nxt_kqueue_conn_io_recvbuf()
1020 c->socket.fd, c->socket.kq_available, c->socket.kq_eof); in nxt_kqueue_conn_io_recvbuf()
[all …]
/unit/auto/
H A Dsockets14 #include <sys/socket.h>
37 #include <sys/socket.h>
55 #include <sys/socket.h>
118 #include <sys/socket.h>
133 #include <sys/socket.h>
151 #include <sys/socket.h>
176 #include <sys/socket.h>
241 #include <sys/socket.h>
257 nxt_feature="socket(SOCK_NONBLOCK)"
263 #include <sys/socket.h>
[all …]
/unit/test/
H A Dtest_proxy_chunked.py3 import socket
19 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
20 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
21 sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
H A Dtest_configuration.py1 import socket
247 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
248 s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
H A Dtest_reconfigure_tls.py1 import socket
37 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
/unit/src/nodejs/unit-http/
H A Dwebsocket_connection.js59 this.socket = socket;
62 this.remoteAddress = socket.remoteAddress;
92 this.socket.setTimeout(0);
98 this.socket.removeAllListeners('error');
100 this._set_sock(this.socket);
185 this.socket.destroy(error);
204 this.socket.end();
284 this.socket.destroy();
314 this.socket.end();
463 this.socket.end();
[all …]
/unit/test/unit/
H A Dutils.py3 import socket
54 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:

1234