mongoc_socket_new (3) - Linux Manuals
mongoc_socket_new: Creates a new mongoc_socket_t structure. This calls socket() underneath to create a network socket.
Command to display mongoc_socket_new
manual in Linux: $ man 3 mongoc_socket_new
NAME
mongoc_socket_new() - Creates a new mongoc_socket_t structure. This calls socket() underneath to create a network socket.
SYNOPSIS
mongoc_socket_t *
mongoc_socket_new (int domain,
int type,
int protocol);
PARAMETERS
- domain
-
An int containing the address family such as AF_INET.
- type
-
An int containing the socket type such as SOCK_STREAM.
- protocol
-
A protocol subset, typically 0.
DESCRIPTION
Creates a new
mongoc_socket_t
structure. This calls
socket(3)
underneath to create a network socket.
RETURNS
A new socket if successful, otherwise
NULL
and errno is set. The result should be freed with
mongoc_socket_destroy(3)
when no longer in use.
COLOPHON
This page is part of MongoDB C Driver.
Please report any bugs at
https://jira.mongodb.org/browse/CDRIVER.
Pages related to mongoc_socket_new
- mongoc_socket_accept (3) - This function is a wrapper around the BSD socket accept() interface. It allows for more portability between UNIX-like and Microsoft Windows platforms.
- mongoc_socket_bind (3) - This function is a wrapper around the BSD socket bind() interface. It provides better portability between UNIX-like and Microsoft Windows platforms.
- mongoc_socket_close (3) - This function is a wrapper around the BSD socket shutdown() interface. It provides better portability between UNIX-like and Microsoft Windows platforms.
- mongoc_socket_connect (3) - This function is a wrapper around the BSD socket connect() interface. It provides better portability between UNIX-like and Microsoft Windows platforms.
- mongoc_socket_destroy (3) - This function releases all resources associated with a mongoc_socket_t. This should be called when you are no longer using the socket.
- mongoc_socket_errno (3) - This function returns the currently captured errno for a socket. This may be useful to check was the last errno was after another function call has been made that clears the threads errno variable.
- mongoc_socket_getnameinfo (3) - This is a helper around getting the local name of a socket. It is a wrapper around getpeername() and getnameinfo().
- mongoc_socket_getsockname (3) - Retrieves the socket name for sock. The result is stored in addr. addrlen should be the size of the addr when calling this.
- mongoc_socket_listen (3) - This function is similar to the BSD sockets listen() function. It is meant for socket servers.
- mongoc_socket_recv (3) - This function performs a recv() on the underlying socket.
- mongoc_socket_send (3) - Sends buflen bytes in buf to the destination. If a timeout expired, the number of bytes sent will be returned or -1 if no bytes were sent.
- mongoc_socket_sendv (3) - Sends a vector of buffers to the destination. This uses sendmsg() when available to perform a gathered write. If IOV_MAX is reached, a fallback will be used.
- mongoc_socket_setsockopt (3) - This is a helper function for setsockopt().
- mongoc_socket_t (3) - Portable socket abstraction
- mongoc_server_description_destroy (3) - This function cleans up all memory associated with the given server description.