[Libwebsockets] Multiple local clients connecting to local server

Mattia Romeo mromeo at giganticmechanic.com
Thu Jun 11 00:37:42 CEST 2015


I’m trying to test some C++ server and client wrappers around libwebsockets locally. Everything works fine when connecting a single local client to a single local server. When I try to connect multiple clients I run into an issue: the server receives messages from all connected clients, but any messages sent from the server are always sent to the last connected client. For example, I set up a simple echo server (i.e. all messages sent to server are sent back to the client) and 3 clients. The server receives all the messages from the clients but the third client receives all the server’s responses.

I can’t find any issues in my code and I vaguely recall hearing that there can only be one local client connected to a local server, so I thought I would check if this is a known limitation with web sockets, or a known issue with libwebsockets before I start tearing my hair out further.

Thanks,
Mattia





More information about the Libwebsockets mailing list