GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  BIO_CLOSESOCKET (3)

.ds Aq ’

NAME

BIO_socket, BIO_connect, BIO_listen, BIO_accept_ex, BIO_closesocket - BIO socket communication setup routines

CONTENTS

SYNOPSIS



 #include <openssl/bio.h>

 int BIO_socket(int domain, int socktype, int protocol, int options);
 int BIO_connect(int sock, const BIO_ADDR *addr, int options);
 int BIO_listen(int sock, const BIO_ADDR *addr, int options);
 int BIO_accept_ex(int accept_sock, BIO_ADDR *peer, int options);
 int BIO_closesocket(int sock);



DESCRIPTION

BIO_socket() creates a socket in the domain domain, of type socktype and protocol. Socket options are currently unused, but is present for future use.

BIO_connect() connects sock to the address and service given by addr. Connection options may be zero or any combination of BIO_SOCK_KEEPALIVE, BIO_SOCK_NONBLOCK and BIO_SOCK_NODELAY. The flags are described in FLAGS below.

BIO_listen() has sock start listening on the address and service given by addr. Connection options may be zero or any combination of BIO_SOCK_KEEPALIVE, BIO_SOCK_NONBLOCK, BIO_SOCK_NODELAY, BIO_SOCK_REUSEADDR and BIO_SOCK_V6_ONLY. The flags are described in FLAGS below.

BIO_accept_ex() waits for an incoming connections on the given socket accept_sock. When it gets a connection, the address and port of the peer gets stored in peer if that one is non-NULL. Accept options may be zero or BIO_SOCK_NONBLOCK, and is applied on the accepted socket. The flags are described in FLAGS below.

BIO_closesocket() closes sock.

FLAGS

BIO_SOCK_KEEPALIVE Enables regular sending of keep-alive messages.
BIO_SOCK_NONBLOCK Sets the socket to non-blocking mode.
BIO_SOCK_NODELAY Corresponds to TCP_NODELAY, and disables the Nagle algorithm. With this set, any data will be sent as soon as possible instead of being buffered until there’s enough for the socket to send out in one go.
BIO_SOCK_REUSEADDR Try to reuse the address and port combination for a recently closed port.
BIO_SOCK_V6_ONLY When creating an IPv6 socket, make it only listen for IPv6 addresses and not IPv4 addresses mapped to IPv6.
These flags are bit flags, so they are to be combined with the | operator, for example:



  BIO_connect(sock, addr, BIO_SOCK_KEEPALIVE | BIO_SOCK_NONBLOCK);



RETURN VALUES

BIO_socket() returns the socket number on success or INVALID_SOCKET (-1) on error. When an error has occured, the OpenSSL error stack will hold the error data and errno has the system error.

BIO_connect() and BIO_listen() return 1 on success or 0 on error. When an error has occured, the OpenSSL error stack will hold the error data and errno has the system error.

BIO_accept_ex() returns the accepted socket on success or INVALID_SOCKET (-1) on error. When an error has occured, the OpenSSL error stack will hold the error data and errno has the system error.

HISTORY

BIO_gethostname(), BIO_get_port(), BIO_get_host_ip(), BIO_get_accept_socket() and BIO_accept() are deprecated since OpenSSL 1.1. Use the functions described above instead.

SEE ALSO

BIO_ADDR(3)
Search for    or go to Top of page |  Section 3 |  Main Index


1.1.0-pre3 BIO_CONNECT (3) 2016-02-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.