Using HTTP & SMTP libs together

Hello,

I have a simple program that is based around the following code -
Sorry if i’ve got the syntax or function names slightly wrong, I’m writing this post from memory


sock_init();
http_init();
tcp_reserveport(80);

while(1){

monitorInputs();
http_handler();
}

The monitorInputs() function checks the status of some of the ports and attempts to send an email is the state has changed.

The general logic of the program runs ok, but it will only send an email if I comment out the http functions.

With the http functions enabled, as shown above, I just get an ‘Error opening socket.’ error with a -450 error number when it attempts to send an email.

Any help or insight would be appreciated.

Regards,
Matt

I might be wrong but I have a strong suspicion you need to increase the amount of allowed sockets in your application. Usually done by :

#define MAX_TCP_SOCKET_BUFFERS 2
#define HTTP_MAXSERVERS 2

Thank you kobuseng!!,

It looks like that has cured my problem.