Socket Communication Program Manual

xiaoxiao2021-03-06  111

Accept (Accept Socket Connection)

related functions

Socket, Bind, Listen, Connect

Header file

#include #include

Definition function

INT Accept (int S, Struct SockAddr * Addr, INT * Addrlen);

Function description

Accept () is used to accept the Socket connection of parameter s. The Socket of the parameter S is necessary to process the BIND (), the listen () function, and accept () will return a new socket processing code when there is a connection, and the subsequent data transfer and reading are processed via the new socket. And the original parameter S Socket can continue to use accept () to accept new connection requirements. When the connection is successful, the structure referred to by the parameter addr will be filled in the address data of the remote host, the parameter addrlen is the structural length of Scokdd. For the definition of structure SOCKADDR, please refer to Bind ().

return value

Success returns a new Socket processing code, failed to return -1, and the error is existed in Errno.

error code

EBADF parameter S non - legitimate Socket processing code. The Efault Parameters addR pointer points to the memory space that cannot be accessed. EnotSock parameter S is a file descriptor, non-socket. EopnotSupp Specifies Socket Not Sock_Stream. Eperm firewall rejects this connection. The buffering memory of the Enobufs system is insufficient. EnomeM core is insufficient.

example

Refer to Listen ().

Bind (targeting socket)

related functions

Socket, Accept, Connect, Listen

Header file

#include #include

Definition function

INT Bind (int Sockfd, struct sockaddr * my_addr, int addrlen);

Function description

Bind () is used to set a name for the Socket for the parameter sockfd. This name is directed by the parameter my_addr to a SockAddr structure, defines a universal data structure for different socket domain, which is the domain parameter when calling socket () for different socket Domain;}; sa_family AF_XXXX value. SA_DATA uses up to 14 characters long. This sockaddr structure due to the use of different socket domain and have different structure definitions, for example AF_INET domain, which socketaddr structure is defined so as struct socketaddr_in {unsigned short int sin_family; uint16_t sin_port; struct in_addr sin_addr; unsigned char sin_zero [8];} Struct in_addr {uint32_t s_addr;}; sin_family, the port number SIN_ADDR.S_ADDR SIN_ADDR.S_ADDR SIN_ADDR.S_ADDR for SA_FAMILYSIN_PORT is not used by IP addresses SIN_ZERO.

parameter

Addrlen is the structure length of SockAddr.

return value

Success returns 0, the failure returns -1, and the error is existed in Errno.

error code

EBADF parameter sockfd non-legitimate SOCKET processing code. EACCESS permissions The enotsock parameter sockfd is a file descriptor, non-socket.

example

Reference listen ()

Connect (create a Socket connection)

Related functions Socket, Bind, Listen

Header file

#include #include

Definition function

INT Connect (int sockfd, struct sockaddr * serv_addr, int addrlen);

Function description

Connect () is used to connect the parameter sockfd's socket to the network address specified by the parameter serv_addr. Structure SockAddr Please refer to Bind (). The parameter addrlen is the structure length of SockAddr.

return value

Success returns 0, the failure returns -1, and the error is existed in Errno.

error code

Ebadf parameter sockfd non-legitimate SOCKET Processing code EFault parameter serv_addr pointer points to the unacceptable memory space EnotSock parameter sockfd is a file descriptor, non-socket. The socket of the Eisconn parameter sockfd is the connection status of the ECONNREFUSED connection request to be rejected by the Server side. ETIMEDOUT attempts to connect operations than limited time still no response. ENETunReach cannot transmit packets to the specified host. The SA_FAMILY of the Eafnosupport SockAddr structure is incorrect. Ealready Socket has not been completed for unbrocessed and previous connection operations.

example

/ * Use the Socket TCP Client This program will connect TCP Server and transfer the keyboard input string to the Server. For the TCP Server example, please refer to Listen (). * / # include #include #include #include #include #include #include #define port 1234 # Define Server_ip "127.0.0.1" main () {int S; struct sockaddr_in addr; char buffer [256]; if ((s = socket (AF_INET, SOCK_STREAM 0)) <0) {PERROR ("socket"); exit (1);} / * Fill in the SockAddr_in structure * / Bzero (& addr, sizeof (addr)); addr.sin_family = AF_INET; addr.sin_port = Htons Port); addr.sin_addr.s_addr = inet_addr (server_ip); / * Try connecting * / if (Connect (S, & Addr) <0) {PERROR ("Connect"); exit (1); } / * Receive information from the Server end * / RECV (S, Buffer, Sizeof (Buffer), 0); Printf ("% S / N", Buffer; While (1) {Bzero (Buffer, Sizeof) Buffer); / * Get strings from standard input devices * / read (stdin_fileno, buffer, sizeof (buffer)); / * Pass string to Server * / if (Send (S, Buffer, Sizeof (buffer) , 0) <0) {Perror ("send"); exit (1);}}}

carried out

$ ./connectwelcome to server! hi i amclient! / * Keyboard input * // * interrupt program * /

EndProtoent (reading network protocol data)

related functions

GetProtoent, getProtobyname, getProtobynumber, setProtoent header file

#include

Definition function

Void endprotoent (void);

Function description

EndProtoent () is used to close files opened by getProtoent ().

return value

example

Reference getprotoent ()

EndServent (reading network service data)

related functions

GetServent, GetServByname, GetServbyport, SetServent

Header file

#include

Definition function

Void endServent (void);

Function description

EndServent () is used to close the files opened by GetServent ().

return value

example

Refer to GetServent ().

Getsockopt (get a socket status)

related functions

Setsockopt

Header file

#include #include

Definition function

INT GetSockopt (int S, int Level, Int Optname, void * optval, socklen_t * optlen);

Function description

GetSockOpt () returns the Socket status specified by the parameter s. Parameters Optname represents what options to make, and parameter OPTVAL points to the memory address to save the result, and the parameter OPTLEN is the size of the space. Parameters Level, Optname Please refer to SetsockOpt ().

return value

Success, return 0, return -1 if there is an error, the error is existed in Errno

error code

Ebadf parameter S is not legal Socket processing code ENOTSOCK parameter S is a file descriptor, non-socketenoprotoopt parameter Optname specified option incorrect EFAULT parameter Optval pointer points to memory space that cannot be accessed

example

#include #include main () {Int S, OptVal, Optlen = SizeOf (int); if ((S = Socket (AF_INET, SOCK_STREAM, 0)) <0) <0 ) PERROR ("socket"); GetSockopt (S, SOL_Socket, SO_TYPE, & OPTVAL, & OPTLEN); Printf ("OptVal =% D / N", OptVal; Close (s);}

carried out

Optval = 1 / * Sock_Stream definition is this value * /

HTONL (transitioning 32-bit host characters in order to network characters)

related functions

Htons, NTOHL, NTOHS

Header file

#include

Definition function

Unsigned long int htonl;

Function description

HTONL () is used to convert the 32-bit hostlong specified by the parameter into a network character order.

return value

Returns the corresponding network character sequence.

example

Refer to GetServByPort () or Connect ().

Htons (transitioning 16 host characters in the order of network characters)

related functions

HTONL, NTOHL, NTOHS

Header file

#include

Definition function

UNSIGNED SHORT INT HTONS (Unsigned Short Int Hostsh); function description

Htons () is used to convert the 16-bit hostshorts specified by the parameter into a network character order.

return value

Returns the corresponding network character sequence.

example

Refer to Connect ().

INET_ADDR (transfer network address to binary)

related functions

inet_aton, inet_ntoa

Header file

#include #include #include

Definition function

Unsigned long int inet_addr (const char * cp);

Function description

INET_ADDR () is used to convert the network address string referred to in the parameter CP into a binary number used by the network. The network address string is a string consisting of numbers and points, such as "163.13.132.68".

return value

Success returns to the corresponding network binary number, failed to return -1.

inet_aton (transfer network address to network binary)

related functions

INET_ADDR, INET_NTOA

Header file

#include #include #include

Definition function

INT INET_ATON (Const Char * CP, Struct In_Addr * INP);

Function description

inet_aton () is used to convert the network address string referred to in the parameter CP into a binary number used, and then exist in the IN_ADDR structure referred to in the parameter INP. Structure in_addr Defines the following struct in_addr {unsigned long int s_addr;};

return value

Success returns a non-0 value and returns 0.

INET_NTOA (converting network binary numbers into network addresses)

related functions

inet_addr, inet_aton

Header file

#include #include #include

Definition function

Char * inet_ntoa (struct in_addr in);

Function description

INET_NTOA () is used to convert the network binary numbers referred to in the parameter in to the network address, and then returns the pointer to this network address string.

return value

Success returns a string pointer and returns NULL.

Listen (wait connection)

related functions

Socket, Bind, Accept, Connect

Header file

#include

Definition function

INT Listen (int S, int backlog);

Function description

Listen () is used to wait for the Socket connection of the parameter S. Parameter backlog Specifies the maximum connection requirements at the same time. If the number of connections reaches the upper limit, the Client end will receive an ECONNREFUSED error. Listen () did not start receiving the connection, just set the socket as the Listen mode, and truly receiving the client connection is Accept (). Usually listen () will be called after socket (), bind (), then call Accept ().

return value

Success returns 0, failed to return -1, the error is existed in Errno

Additional information

Listen () is only applicable to the socket type of Sock_Stream or Sock_seqpacket. If the socket is AF_INET, the parameter backlog maximum can be set to 128.

error code

Ebadf Parameters SOCKFD Non Legal Socket Processing Code EACCESS Permissions The specified Socket is not supported in the Listen mode. example

#include #include #include #include #include #define port 1234 # Define MaxSockfd 10main () {int sockfd, newsockfd, is_connected [MAXSOCKFD], fd; struct sockaddr_in addr; int addr_len = sizeof (struct sockaddr_in); fd_set readfds; char buffer [256]; char msg [] = "Welcome to server!"; IF ((SOCKFD = Socket (AF_INET, SOCK_STREAM, 0) <0) {Perror ("socket"); exit (1);} Bzero (& addr, sizeof (addr)); addr.sin_family = af_inet; addr.sin_port = htons (port); addr.sin_addr.s_addr = htonl (INADDR_Any); if (Bind (SockFD, & Addr, SizeOf (AddR)) <0) {Perror ("Connect"); exit (1);} if (listen) (SOCKFD, 3) <0) {Perror ("listen"); exit (1);} for (fd = 0; fd

carried out

$ ./listenconnect from 127.0.0.1hi i amclientconnected closed.

NTOHL (convert 32-bit network character sequence into host characters)

related functions

HTONL, HTONS, NTOHS

Header file

#include

Definition function

Unsigned long int NTOHL (Unsigned long int netlong); function description

NTOHL () is used to convert the 32-bit NETLONG specified by the parameter into a host character sequence.

return value

Returns the corresponding host character sequence.

example

Refer to GetServent ().

NTOHS (convert 16-bit network character sequence into host character sequence)

related functions

HTONL, HTONS, NTOHL

Header file

#include

Definition function

UNSIGNED SHORT INT NTOHS (UNSIGNED SHORT INT NETSHORT);

Function description

NTOHS () is used to convert the 16-bit Netshort specified by the parameter to the host character sequence.

return value

Returns the corresponding host order.

example

Refer to GetServent ().

RECV (received data by Socket)

related functions

Recvfrom, Recvmsg, Send, Sendto, Socket

Header file

#include #include

Definition function

INT RECV (Int S, Void * BUF, INT LEN, UNSIGNED INT FLAGS);

Function description

RECV () is used to receive data from the specified Socket specified, and save the data to the memory space pointed to by the parameter BUF, and the parameter LEN is the maximum length of the received data.

parameter

Flags are generally 0. Other values ​​are defined as follows: MSG_oob receives data sent in OUT-OF-BAND. The data returned by MSG_peek does not delete in the system, if the recall RECV () will return the same data content. MSG_WAITALL forced data to receive the Len size before returning, unless there is an error or signal generation. MSG_NOSignal This operation is not willing to be successfully returned by the SIGPIPE signal, returns the number of characters received, and the failure returns -1, and the error is stored in Errno.

error code

Ebadf Parameters S Non Legal Socket Processing Code EFault Parameters There is a pointer pointing to the unacceptable memory space EnotSock parameter S is a file descriptor, non-socket. EINTR is interrupted by the signal to block the process to block the process, but the Socket of the parameter S is insufficient to block the buffer memory that cannot block the Enobufs system. EnomeM core memory is incorrect with EINVAL pass to the system call.

example

Refer to Listen ().

Recvfrom (received data received by Socket)

related functions

RECV, Recvmsg, Send, Sendto, Socket

Header file

#include #include

Definition function

INT Recvfrom (int LEN, Unsigned Int Flags, Struct SockAddr * from, int * fromlen);

Function description

Recv () is used to receive data from the specified Socket, and save the data to the memory space points to by the parameter BUF, the parameter LEN is the maximum length of the received data. Parameter Flags is typically set 0, please refer to RECV () for other numerical definitions. The parameter from the network address used to specify the network address to be transmitted, and the structure SockAddr refers to Bind (). Parameter from Fromlen is the structure length of SockAddr.

return value

Success returns the number of characters received, and the failure returns -1, and the error is existed in Errno.

error code

Ebadf parameter s non-legitimate Socket Processing code EFault parameters There is a pointer pointing to memory space that cannot be accessed. EnotSock parameter S is a file descriptor, non-socket. EINTR is interrupted by the signal. EAGAIN This action will block the process, but the Socket of the parameter S is not blockable. The Enobufs system's buffer memory is not enough ENOMEM core memory instead of EINVAL. example

/ * Using Socket's UDP Client This program will connect UDP Server and pass the keyboard input to the Server. For the UDP Server example, please refer to Sendto (). * / # include #include #include #include #include #include #include #define port 2345 # Define Server_ip "127.0.0.1" main () {Int S, Len; struct sockaddr_in addr; int addressdr_len = sizeof (struct sockaddr_in); char buffer [256] ; / * Establish Socket * / if ((s = socket, sock_dgram, 0) <0) {PERROR ("socket"); exit (1);} / * Fill in SockAddr_in * / Bzero (& Addr, Sizeof Addr); addr.sin_family = AF_INET; addr.sin_port = htons (port); addr.sin_addr.s_addr = inet_addr (server_ip); While (1) {Bzero (Buffer, sizeof (buffer)); / * From standard input Equipment gets string * / len = read (stdin_fileno, buffer, sizeof (buffer); / * Transferring strings to Server * / sendto (s, buffer, len, 0, & addr, addr_len); / * Receive Server Returned string * / len = recvfrom (s, buffer, sizeof (buffer), 0, & addr, & addr_len; printf ("receive:% s", buffer;}}

carried out

(UDP Server and then execute UDP client) hello / * Enter string from the keyboard * / receive: Hello / * Server end comes back * /

Recvmsg (received data by socket)

related functions

RECV, Recvfrom, Send, Sendto, Sendmsg, Socket

Header file

#include #include

Definition function

INT Recvmsg (int S, Struct Msghdr * MSG, Unsigned Int Flags);

Function description

Recvmsg () is used to receive data from the remote host to the specified Socket. The parameter S is a Socket that has been established, and if the UDP protocol is used, it does not need to be connected. Parameter MSG points to the data structure content of wiring, parameter FLAGS is generally 0, please refer to Send (), please refer to Send (). For the definition of structural MSGHDR, please refer to SendMSG ().

return value

Success returns the number of characters received, and the failure returns -1, and the error is existed in Errno.

error code

Ebadf parameter S non-legitimate Socket processing code. In the EFault parameter, you have a pointer to the unacceptable memory space EnotSock parameter S is a file descriptor, non-socket. EINTR is interrupted by the signal. EAGAIN This action will block the process, but the Socket of the parameter S cannot be blocked. The Enobufs system's buffer memory is not enough ENOMEM core memory instead of EINVAL. example

Refer to RECVFROM ().

Send (via Socket Transfer Data)

related functions

Sendto, Sendmsg, Recv, Recvfrom, Socket

Header file

#include #include

Definition function

INT Send (int LEN, Unsigned Int falgs);

Function description

Send () is used to pass the data by the specified Socket to the other party host. The parameter S is a Socket that has been established. The parameter MSG points to the data content that is wired, and the parameter LEN is the data length. Parameter Flags typically set 0, other values ​​define the data transmitted by the MSG_oob as follows Out-of-Band. MSG_DONTROUTE Cancel Routing Table Query MSG_DONTWAIT Set to Unblable Operation MSG_NOSignal This action is not willing to be interrupted by the SIGPIPE signal.

return value

Success returns the number of characters that actually transmits, and the failure returns -1. Error reason exists in errno

error code

Ebadf parameter S non-legitimate Socket processing code. In the EFault parameter, you have a pointer to the unacceptable memory space EnotSock parameter S is a file descriptor, non-socket. EINTR is interrupted by the signal. EAGAIN This action will block the process, but the Socket of the parameter S cannot be blocked. The Enobufs system's buffer memory is not enough ENOMEM core memory instead of EINVAL.

example

Refer to Connect ()

Sendmsg (Socket Transfer Data)

related functions

Send, Sendto, Recv, Recvfrom, Recvmsg, Socket

Header file

#include #include

Definition function

INT Sendmsg (int S, Const strcut msghdr * msg, unsigned int flags);

Function description

Sendmsg () is used to pass the data by the specified Socket to the other party host. The parameter S is a Socket that has been established, and if the UDP protocol is used, it does not need to be connected. Parameter MSG points to the contents of the data structure to be wired, the parameter Flags is generally default to 0, and please refer to Send (). Structure msghdr defined as follows struct msghdr {void * msg_name; / * Address to send to / receive from * / socklen_t msg_namelen;. / * Length of addres data * / strcut iovec * msg_iov; / * Vector of data to send / receive into * / size_t msg_iovlen; / * Number of elements in the vector * / void * msg_control; / * Ancillary dat * / size_t msg_controllen; / * Ancillary data buffer length * / int msg_flags; / * Flags on received message * /};

return value

Success, return the number of characters actually transmitted, and the failure returns -1, and the error is existed in Errno error code.

Ebadf parameter S non-legitimate Socket processing code. In the EFault parameter, you have a pointer to the unacceptable memory space EnotSock parameter S is a file descriptor, non-socket. EINTR is interrupted by the signal. EAGAIN This action will block the process, but the Socket of the parameter S cannot be blocked. The Enobufs system's buffer memory is not enough ENOMEM core memory instead of EINVAL.

example

Refer to Sendto ().

Sendto (Socket Transfer Data)

related functions

Send, Sendmsg, Recv, Recvfrom, Socket

Header file

#include #include

Definition function

Int Sendto (int LEN, Unsigned Int Flag, Int Len, Unsigned Int Flags, Const Struct SockAddr * To, INT TOLEN);

Function description

Sendto () is used to pass the data from the specified Socket to the other party. The parameter S is a Socket that has been built, and if the UDP protocol is used, it does not need to be operated. The parameter MSG points to the data content of the wiring, the parameter Flags is generally 0, and please refer to Send (). The parameter TO is used to specify the network address to be transferred, and the structure SOCKADDR is referred to BIND (). The parameter TOLEN is the result length of SockAddr.

return value

Success, return the number of characters actually transmitted, the failure returns -1, and the error is existed in Errno.

error code

Ebadf parameter s illegal Socket processing code. There is a pointer in the efault parameter to point to the memory that cannot be accessed. WNOTSOCK CANSHU S is a file description word, non-socket. EINTR is interrupted by the signal. EAGAIN This action will block the process, but the SOKET of the parameter S is blocking. The buffering memory of the Enobufs system is insufficient. The parameters passing to the system call to the system are incorrect.

example

#include #include # include #include #define port 2345 / * port * / main () {Int SockFD, Len; Struct SockAddr_in Addr; Char Buffer [256]; / * Establish Socket * / IF (SockFD = Socket (AF_INET, SOCK_DGRAM, 0) <0) {Perror ("Socket"); EXIT (1) } / * Fill in the sockaddr_in structure * / bzero (& addr); addr.sin_family = AF_INET; addr.sin_port = htons (port); addr.sin_addr = HTON1 (INADDR_ANY); if (Bind (Sockfd, & Addr) , SIZEOF (ADDR) <0) {Perror ("Connect"); exit (1);} while (1) {bezro (buffer, sizeof (buffer); len = recvfrom (socket, buffer, sizeof (buffer) , 0, & addr & addr_len; / * Display the network address of the client * / Printf ("Receive FROM% S / N", INET_NTOA (Addr.sin_ADDR)); / * Return the string to the client * / sendto (sockfd, Buffer, Len, 0, & Addr, AddR_len; "}}

Please refer to Recvfrom ()

SetProtoent (Open the data file of the network protocol)

related functions

GetProtobyname, GetProtobynumber, Endprotoent

Header file

#include

Definition function

Void setProtoent (int Stayopen);

Function description

SetProtoent () is used to open / etc / protocols, if the parameter stayopen value is 1, then the next getProtobyname () or getProtobynumber () will not automatically turn this file.

SetServent (Open the data file of the host network service)

related functions

GetServent, GetServByname, GetServbyport, EndServent

Header file

#include

Definition function

Void setServent (int Stayopen);

Function description

SetServent () is used to open / etc / services, if the parameter StayOpen value is 1, then the next getServByName () or getServByport () will return to the automatic shutdown file.

Setsockopt (Set up Socket Status)

related functions

GetSockopt

Header file

#include #include

Definition function

Int setsockopt (int S, int level, int iptname, const void * optval, socklen_toptlen);

Function description

Setsockopt () is used to set the Socket status specified by the parameter S. The parameter Level represents the network layer that wants to set, which is typically set to SOL_Socket to access the Socket layer. Parameter Optname Represents options to set, with the following values: SO_DEBUG Opening or closing the error mode SO_REUSEADDR Allows the local address to reuse the SOCKET form in the bind () process. SO_ERROR Returns the error reason for the resulting Error Reason for SO_DONTROUTE Do not use routing devices to transmit. SO_BROADCAST uses broadcast mode to transfer SO_SNDBUF Settings Send Temporal Size SO_RCVBUF Set whether the received temporary area SO_KEEPALIVE periodically determines whether the connection has been terminated. SO_OOBINLINE will immediately send it to the standard input device so_linger when it receives OOB data. Make sure data is safe and reliable. parameter

OptVal represents the value set, the parameter OPTLEN is the length of OptVal.

return value

Success returns 0, if there is an error, return -1, the error is existed in Errno.

Additional information

EBADF parameter S is not legal Socket processing code ENOTSOCK parameter S is a file descriptor, non-socketenoprotoopt parameter OptName The option specified is incorrect. Efault Parameters Optval Pointer Pointer to Unrecognized memory space.

example

Refer to GetSockOpt ().

Shutdown (Termination Socket Communication)

related functions

Socket, Connect

Header file

#include

Definition function

INT Shutdown (int S, int how);

Function description

Shutdown () is used to terminate the Socket connection specified by the parameter s. The parameter S is the Socket processing code in the connection. The parameter HOW has the following cases: how = 0 terminates the read operation. How = 1 Termination Transfer Operation How = 2 Terminate Read and Transfer Operation

return value

Success returns 0, failed to return -1, and the error is existed in Errno.

error code

EBADF parameter S is not a valid socket processing code ENOTSOCK parameter S is a file descriptor, the SocketConn parameter s specified Socket is not connected

Socket (create a socket communication)

related functions

Accept, Bind, Connect, Listen

Header file

#include #include

Definition function

INT Socket (int Domain, int type, int protocol);

Function description

Socket () is used to create a new Socket, which is to register to the system, notify the system to establish a communication port. Parameter Domain Specifies what kind of address type, complete definition is within /usr/include/bits/socket.h, is a common protocol: PF_UNIX / PF_LOCAL / AF_UNIX / AF_LOCAL UNIX process communication protocol PF_INET? AF_INET IPv4 Network Protocol PF_INET6 / AF_INET6 Ipv6 network protocol PF_IPX / AF_IPX IPX-Novell protocol PF_NETLINK / AF_NETLINK core user interface device PF_X25 / AF_X25 ITU-T X.25 / ISO-8208 protocol PF_AX25 / AF_AX25 amateur radio AX.25 protocol PF_ATMPVC / AF_ATMPVC access the original ATM PVCsPF_APPLETALK / AF_APPLETALK AppleTalk (DDP) Protocol PF_PACKET / AF_PACKET Junior Packet Interface

parameter

Type has the following values: Sock_Stream provides two-way continuous and trusted data streams, namely TCP. Support OOB mechanisms, you must use Connect () to establish a connection status before all data transfer. SOCK_DGRAM Connection Sock_seqpacket provides continuously reliable packet connection SOCK_SEQPACKET to provide SOCK_RAW to provide raw network protocol Access SOCK_RDM to provide a trusted packet connection SOCK_PACKET Provider to communicate directly to the network driver. Protocol is used to specify the transfer protocol number used by the socket, usually this reference does not need to be used, set to 0. return value

Success returns the socket processing code, failed to return -1.

error code

EPROTONOSUPPORT Parameter Domain Specifies the type of Type or Protocol, which is not supported, the core memory is insufficient, and unable to establish a new Socket structure Emfile process file table overflow, unable to establish a new SocketeAccess permission, unable to establish a Type or protocol specified protocol ENOBUFS / ENOMEM insufficient einval parameter Domain / Type / protocol is not legal

example

Refer to Connect ().

转载请注明原文地址:https://www.9cbs.com/read-99573.html

New Post(0)