Chat freely about anything...

User avatar
By eriksl
#16790 I'd like to have a feature to be able to select the max of simultanuous connections. Now it's more or less unlimited, which I guess, is fine for many applications, but in my situation it results in data ending up on the wrong connection. I'd rather have a "connection refused" as long as another client is still connected.

I am probably going to fork and implement this shortly.
User avatar
By eriksl
#16914 I started some work on it, but finally took a completely other approach. I couldn't make heads nor tails of the code. That's not your fault, I blame the esp guys. They really don't seem to know how to write decent and readable code. I really hope the closed/proprietary code is of a higher standard than this code.

So I threw everything away and started from scratch. Every feature was thrown out and every line that's not necessary was also thrown out. I now have a project of 1 directory, 8 files (from which 1 is actual source), 217 lines of c code in total. And it works. The makefile now also works, it only compiles files that have changed and depend on it. The baud rate and the ap parameters must be hardcoded, there is no interface to flash, I don't see the point.

The max number of tcp connections is also hard coded now, as a matter of fact, with the current code it's not even possible to serve more than one connection. I don't see the need for multiple connections for my application.

What's interesting is, is that if you set the max number of tcp connections to "1", the esp doesn't send a RST (connection reset) but simply doesn't answer when there is already a connection. The con is that the second connecting party doesn't know it can't connect immediately, the pro is that if the first connecting party leaves pretty quick, the second will connectly automatically.

I think this version is much more suitable for extension with some features.

For those who'd like to take a look: https://github.com/eriksl/esp8266-basic-bridge