rcsoccersim / rcssserver

The RoboCup Soccer Simulator Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Narrow the port range, assigned to monitors and/or clients

gikari opened this issue · comments

I'm trying to set up Docker environment with RoboCup server, clients and monitors. Monitor is a GUI app and therefore it cannot be easily run in docker. Because of that, I need to expose some ports of the server, so that is can connect from outside of Docker network.

Unfortunately after the connection to the default 6000 port, the server assigns a new port to the monitor, which is random in a possible range from 30000 to 60000 or may be even more. Because of that fact, I need to bind a lot of ports, when setting up a docker container. This is a very slow operation and because of that I cannot create a docker container in a reasonable time (See also).

To fix that issue, I propose to narrow the port range, which is assigned to the monitor and/or clients. For example a range with 100 ports would be sufficient. It is relatively fast, when running a docker container, to bind them, covers 22 players and additionally a lot of monitors.

If that range is too low for some reason, it would be nice at least make the range configurable.

As you mentioned, the monitor connection is one of the problems. I'm not so familiar with network programming, I'm not sure assigning the port range is a better solution or not. However, it would be nice we separate the monitor port from the player's one.

Another idea is a proxy client. Now, I'm planning to develop a simple proxy client that transfers the monitor message via TCP/IP.

@gikari I don't know if you still need it but we have done something very similar in https://github.com/rcssggb/ggb-demo by exposing the X11 server to the container running rcssmonitor using the xhost utility. Feel free to reach out if you have any questions! I also believe an option to limit the port range would be a nice feature to make easier working with rcss in containers.