mpConnect
Initiate a connection to a socket
Syntax
#include “mpSocket.h”
LONG connect(LONG sockfd, const struct sockaddr *addr, LONG addrlen);
Description
If s is a socket of type SOCK_STREAM, this routine establishes a virtual circuit between s and another socket specified by name. If s is of type SOCK_DGRAM, it permanently specifies the peer to which messages are sent. If s is of type SOCK_RAW, it specifies the raw socket upon which data is to be sent and received. The name parameter specifies the address of the other socket.
Parameter
[sockfd]
Socket descriptor created by mpSocket.
[addr]
Pinter of the sockaddr structure kept socket address.
Actual pointer of addr depends on address family but Moto-Pro supports only sockaddr_in.
[addrlen]
Size of the address structure of the addr
Return
0 :Normal end
Non Zero: error
Partager