...
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
- The network security manager MUST be available and enabled to open a secure POP3 connection (i.e: in “net_cfg.h”,
NET_SECURE_CFG_EN
should beDEF_ENABLED
ANDNET_CFG_TRANSPORT_LAYER_SEL
should be configured for TCP). See µC/TCPIP user manual for more information about the network security manager. - A network security module MUST be included in the project (i.e: µC/SSL) to use the network security manager functionalities.
Notes / Warnings
- If anything goes wrong while trying to connect to the server, the socket is closed by calling
NetSock_Close()
. Hence, all data structures are returned to their original state in case of a failure. - Before opening a secure POP3 connection, a certificate authority MUST be installed to validate the server identity.
Example Usage
See section 3-3 “µC/POP3c Example Code”See Sample Application.