-->
Page 1 of 1

TCP-Server and client connection

PostPosted: Tue Mar 03, 2015 4:24 am
by SpenZerX
Hello,

i have created an TCP-Server with function espconn_accept. Callbacks are installed. Everything is working. New Connections are detected (New Connection Callback) and answered.

Now i want to start an extra client connection for submitting information from a queue to an other server.
The TCP-Server should not stop its work.

Whats the best way to do this?

Simply call function Connect? (gives error -15 (in use)) Should then rise Connected Callback for this client connection? Is it allowed to call Connect when in Server Mode with espconn_accept?

Or is it required to create new structures ESPCONN & ESP_TCP and than make a complete new Connection for the client-connection task?

Re: TCP-Server and client connection

PostPosted: Tue Mar 03, 2015 8:16 am
by new299
Yes, you need to create a new client connection, my notes on client mode are here:

http://41j.com/blog/2015/01/esp8266-cli ... e-example/

I've used ran both TCP clients and servers in the same codebase here:

https://github.com/Safecast/bGeigieNano_ESP8266

Which may be instructive.