The mfp_Connect function establishes a connection to the Message Feed server.
The function returns an opaque handle for the connection. This handle must be freed using the mfp_Disconnect
function. If an error occurs, the function returns a NULL value.
h_mfp mfp_Connect(char const* pHost, char const* pService, int Timeout);
pHost
– Name of the TCP/IP host where the Message Feed server is located.pService
– Name of the TCP/IP service which the Message Feed server listens to. Timeout
– Timeout, in seconds, being used for socket access to the Message Feed server. mfp_GetLastError
function to get a textual description of the error.
#include "mfp.h"; ... h_mfp hMFP; hMFP = mfp_Connect("localhost", "12345", 60); if(hMFP == NULL) { printf("failed to connect to Message Feed server: %s\n", mfp_GetLastError()); exit(1);
} ... if(mfp_Disconnect(hMFP) != 0) { printf("failed to disconnect from Message Feed server: %s\n", mfp_GetLastError()); exit(1); } ... |