Lines Matching refs:sock
43 int sock = -1;
48 sock = socket(domain, socktype, protocol);
49 if (sock == -1) {
56 return sock;
61 * @sock: the socket to connect with
79 int BIO_connect(int sock, const BIO_ADDR *addr, int options)
83 if (sock == -1) {
88 if (!BIO_socket_nbio(sock, (options & BIO_SOCK_NONBLOCK) != 0))
92 if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE,
102 if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
111 if (connect(sock, BIO_ADDR_sockaddr(addr),
127 ktls_enable(sock);
134 * @sock: the socket to set
148 int BIO_bind(int sock, const BIO_ADDR *addr, int options)
154 if (sock == -1) {
165 if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
175 if (bind(sock, BIO_ADDR_sockaddr(addr), BIO_ADDR_sockaddr_size(addr)) != 0) {
187 * @sock: the socket to listen with
222 int BIO_listen(int sock, const BIO_ADDR *addr, int options)
228 if (sock == -1) {
233 if (getsockopt(sock, SOL_SOCKET, SO_TYPE,
242 if (!BIO_socket_nbio(sock, (options & BIO_SOCK_NONBLOCK) != 0))
246 if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE,
256 if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
273 if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
283 if (!BIO_bind(sock, addr, options))
286 if (socktype != SOCK_DGRAM && listen(sock, MAX_LISTEN) == -1) {
298 * @sock: the listening socket
332 * @sock: the socket to close
334 int BIO_closesocket(int sock)
336 if (sock < 0 || closesocket(sock) < 0)