We currently have a program that has 2 serial devices and a TCP device that we poll. Part of this data is displayed on the customer web browser on a realtime display. This currently work with the following 2 issues. On this communication is mostly one-way by design from the 5234 server to the client, we don't current have any type of keep alive packet. We have discovered that if you refresh or navigate from the page we use all 4 sockets that are allocated in the .h file. We have increased this to 10 sockets just to experiment. We assume somehow we need to since these connections have become lost and clean them up somehow? We can see ws-fd returns a number and increments up but our unsure how to reclaim the sockets. If we need to we could have a keep alive sent from the browser but then need to know the best way to manage?
The second question and this one is less important as normally our customer uses one PC but is there a we to manage multiusers on websockets?
Today the last one in wins.
Thanks,
David
MOD 5234 Websockets How to handle connections
-
- Posts: 5
- Joined: Fri Sep 03, 2021 10:12 pm
Re: MOD 5234 Websockets How to handle connections
select (see other answer ) is how to manage multiple connections, serial, websocket, tcp etc...
any tcp/ or websocket you open you must close or you have a leak.
with tcp you can detect dead sockets with
DWORD TcpGetLastRxTime( int fd );
void TcpSendKeepAlive ( int fd );
For websockets.... I need to ask the websocket person...
Well get back to you..
any tcp/ or websocket you open you must close or you have a leak.
with tcp you can detect dead sockets with
DWORD TcpGetLastRxTime( int fd );
void TcpSendKeepAlive ( int fd );
For websockets.... I need to ask the websocket person...
Well get back to you..
Re: MOD 5234 Websockets How to handle connections
Websockets have a Ping/Pong method defined in the spec, which was not fully implemented or exposed through the API. Open a support ticket, and we can send you a patch.
-Dan
-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Project Engineer
Netburner, Inc