Establishes a TCP connection with the POP3 server.
Files
pop3-c.h/pop3-c.c
Prototype
Arguments
ip_server
IP address of the POP3 server to contact.
port
TCP port to use. If ‘0’, pre-configured port is used
.
secure Desired value for client secure mode.
DEF_ENABLED
Client operations will be secured.
DEF_DISABLED
Client operations will not be secured.
perr
Pointer to a variable that will hold the return error code from this function:
POP3c_ERR_NONE
POP3c_ERR_SOCK_OPEN_FAILED
POP3c_ERR_SOCK_CONN_FAILED
POP3c_ERR_NEG_RESP
POP3c_ERR_RX_FAILED
Returned Values
Connected socket ID, if no errors;
-1, otherwise.
Required Configuration
NET_SECURE_CFG_EN
should be DEF_ENABLED
AND NET_CFG_TRANSPORT_LAYER_SEL
should be configured for TCP). See µC/TCPIP user manual for more information about the network security manager.Notes / Warnings
NetSock_Close()
. Hence, all data structures are returned to their original state in case of a failure.