.TH "socket" 3teegris "Sun Oct 28 2018" "Version 2.0" "Samsung Internal API reference" \" -*- nroff -*-
.ad l
.nh
.SH NAME
socket \- Socket library API
.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBaccept\fP (int sockfd, struct sockaddr *addr, int *addrlen)"
.br
.RI "\fIAccept a connection on a socket\&. \fP"
.ti -1c
.RI "int \fBbind\fP (int sockfd, const struct sockaddr *addr, int addrlen)"
.br
.RI "\fIBind a name to a socket\&. \fP"
.ti -1c
.RI "int \fBconnect\fP (int sockfd, const struct sockaddr *addr, int addrlen)"
.br
.RI "\fIInitiate a connection on a socket\&. \fP"
.ti -1c
.RI "int \fBgetsockopt\fP (int sockfd, int level, int optname, void *optval, int *optlen)"
.br
.RI "\fIGet options on socket\&. \fP"
.ti -1c
.RI "int \fBsetsockopt\fP (int sockfd, int level, int optname, void *optval, int optlen)"
.br
.RI "\fIGet options on socket\&. \fP"
.ti -1c
.RI "int \fBlisten\fP (int sockfd, int backlog)"
.br
.RI "\fIListen for connections on a socket\&. \fP"
.ti -1c
.RI "int \fBsocket\fP (int socket_family, int socket_type, int protocol)"
.br
.RI "\fICreate endpoint for communication\&. \fP"
.ti -1c
.RI "\fBssize_t\fP \fBrecv\fP (int sockfd, void *buf, size_t len, int flags)"
.br
.RI "\fIReceive a message from a socket\&. \fP"
.ti -1c
.RI "\fBssize_t\fP \fBsend\fP (int sockfd, const void *buf, size_t len, int flags)"
.br
.RI "\fISend a message to a socket\&. \fP"
.ti -1c
.RI "int \fBsocketpair\fP (int socket_family, int socket_type, int protocol, int sv[2])"
.br
.RI "\fICreate a pair of connected sockets\&. \fP"
.ti -1c
.RI "\fBssize_t\fP \fBrecvmsg\fP (int sockfd, struct msghdr *msg, int flags)"
.br
.RI "\fIReceive multipple message on a socket\&. \fP"
.ti -1c
.RI "\fBssize_t\fP \fBsendmsg\fP (int sockfd, struct msghdr *msg, int flags)"
.br
.RI "\fISend multipple message on a socket\&. \fP"
.in -1c
.SH "Detailed Description"
.PP 

.SH "Function Documentation"
.PP 
.SS "int accept (int sockfd, struct sockaddr * addr, int * addrlen)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Accept a connection on a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP listening socket descriptor 
.br
\fIaddr\fP pointer to a sockaddr structure 
.br
\fIaddrlen\fP size of structure pointed to by addr 
.RE
.PP
\fBReturns:\fP
.RS 4
nonnegative file descriptor for the accepted socket on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "int bind (int sockfd, const struct sockaddr * addr, int addrlen)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Bind a name to a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fIaddr\fP address to the socket 
.br
\fIaddrlen\fP size of the address structure 
.RE
.PP
\fBReturns:\fP
.RS 4
0 on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "int connect (int sockfd, const struct sockaddr * addr, int addrlen)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Initiate a connection on a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fIaddr\fP address to the socket 
.br
\fIaddrlen\fP size of the address structure 
.RE
.PP
\fBReturns:\fP
.RS 4
0 on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "int getsockopt (int sockfd, int level, int optname, void * optval, int * optlen)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Get options on socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fIlevel\fP socket API level 
.br
\fIoptname\fP specified options 
.br
\fIoptval\fP buffer in which the value of the requested options are to be returned 
.br
\fIoptlen\fP the size of the buffer pointed to by optval 
.RE
.PP
\fBReturns:\fP
.RS 4
0 on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "int listen (int sockfd, int backlog)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Listen for connections on a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fIbacklog\fP maximum length to which the queue of pending connections for sockfd may grow 
.RE
.PP
\fBReturns:\fP
.RS 4
0 on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "\fBssize_t\fP recv (int sockfd, void * buf, size_t len, int flags)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Receive a message from a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fIbuf\fP pointer to a message buffer 
.br
\fIlen\fP message length 
.br
\fIflags\fP type of receiving 
.RE
.PP
\fBReturns:\fP
.RS 4
number of bytes received on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "\fBssize_t\fP recvmsg (int sockfd, struct msghdr * msg, int flags)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Receive multipple message on a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fImsg\fP pointer to an array of msghdr structures 
.br
\fIflags\fP type of receiving 
.RE
.PP
\fBReturns:\fP
.RS 4
number of messages received in msg on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "\fBssize_t\fP send (int sockfd, const void * buf, size_t len, int flags)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Send a message to a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fIbuf\fP pointer to a message buffer 
.br
\fIlen\fP message length 
.br
\fIflags\fP type of sending 
.RE
.PP
\fBReturns:\fP
.RS 4
number of bytes sent on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "\fBssize_t\fP sendmsg (int sockfd, struct msghdr * msg, int flags)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Send multipple message on a socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fImsg\fP pointer to an array of msghdr structures 
.br
\fIflags\fP type of sending 
.RE
.PP
\fBReturns:\fP
.RS 4
number of messages sent from msg on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "int setsockopt (int sockfd, int level, int optname, void * optval, int optlen)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Get options on socket\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsockfd\fP socket descriptor 
.br
\fIlevel\fP socket API level 
.br
\fIoptname\fP specified options 
.br
\fIoptval\fP buffer in which the value of the requested options are to be returned 
.br
\fIoptlen\fP the size of the buffer pointed to by optval 
.RE
.PP
\fBReturns:\fP
.RS 4
0 on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "int socket (int socket_family, int socket_type, int protocol)"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Create endpoint for communication\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsocket_family\fP communication domain 
.br
\fIsocket_type\fP communication semantics specifier 
.br
\fIprotocol\fP particular protocol to be used with the socket 
.RE
.PP
\fBReturns:\fP
.RS 4
nonnegative file descriptor for the new socket on success 
.PP
-1 with errno on error 
.RE
.PP

.SS "int socketpair (int socket_family, int socket_type, int protocol, int sv[2])"

.PP
\fC#include <\fBsys/socket\&.h\fP>\fP
.PP
Create a pair of connected sockets\&. 
.PP
\fBParameters:\fP
.RS 4
\fIsocket_family\fP communication domain 
.br
\fIsocket_type\fP communication semantics specifier 
.br
\fIprotocol\fP particular protocol to be used with the socket 
.br
\fIsv\fP file descriptors 
.RE
.PP
\fBReturns:\fP
.RS 4
0 on success 
.PP
-1 with errno on error 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for Samsung Internal API reference from the source code\&.
