multi connections to a single tcp server
multi connections to a single tcp server
Postby alexchang » Wed Apr 22, 2015 11:40 pm
We meet a problem when we use espconn_connect api call.
We want to simulate the node.js's socket.io (websocket) under our private server, but we don't get the chance and not lucky enough to use the regular websocket transport, we still use polling transport to talk with socket.io server.
By using to tcp connection, one uses to polling data from server, one uses as post data to server, by this case, we need a fixed polling tcp connection constantly connected with server, and another tcp connection used to update the esp8266 status, which is how's the light on or off, how's the plug on or off, but right now when we raise another connection to the same server we got the error below:
#define ESPCONN_ISCONN -15 /* Already connected. */
Is there any way to work around the this limitation? Thanks!
We want to simulate the node.js's socket.io (websocket) under our private server, but we don't get the chance and not lucky enough to use the regular websocket transport, we still use polling transport to talk with socket.io server.
By using to tcp connection, one uses to polling data from server, one uses as post data to server, by this case, we need a fixed polling tcp connection constantly connected with server, and another tcp connection used to update the esp8266 status, which is how's the light on or off, how's the plug on or off, but right now when we raise another connection to the same server we got the error below:
#define ESPCONN_ISCONN -15 /* Already connected. */
Is there any way to work around the this limitation? Thanks!
Re: multi connections to a single tcp server
Postby alexchang » Thu Apr 23, 2015 11:08 am
Is there way to open two connections? By using polling transport to talk with socket.io server, we need to simulate PING/PONG (keep alive) protocal then we need two open connections.
Re: multi connections to a single tcp server
Postby alexchang » Thu Apr 23, 2015 2:00 pm
>TCP multi connection,at least , remote port need to be different, pespconn->proto.tcp->remote_port
I mean multi connections under same port and same ip open at the same time.
Or can you help us import this library?
http://socket.io/blog/socket-io-cpp/
I mean multi connections under same port and same ip open at the same time.
Or can you help us import this library?
http://socket.io/blog/socket-io-cpp/
-
- Posts: 1
- Joined: Mon Oct 16, 2017 7:03 pm
Re: multi connections to a single tcp server
Postby JamesBlack » Mon Oct 16, 2017 7:24 pm
Hi
I know its an old discussion, but I have the same problem.
I made it work using C-only language. When I'm trying to use C++, this exact problem happens.
I heard in some versions there was a bug related to local_port assignment.
Any chance something like this is inside C++ libraries? I'm using Non-OS SDK 2.0.0.
Thanks
I know its an old discussion, but I have the same problem.
I made it work using C-only language. When I'm trying to use C++, this exact problem happens.
I heard in some versions there was a bug related to local_port assignment.
Any chance something like this is inside C++ libraries? I'm using Non-OS SDK 2.0.0.
Thanks
Who is online
Users browsing this forum: No registered users and 307 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.