-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remotery reuses ports #109
Comments
So is this actually a problem for you? I assume along with 2 processes you also have 2 clients, or do you want them both to connect to the same client? |
Well, since I'm not an expert in network software, I am assuming you cannot have two software share the same port and them talk to 1 single client. If it is however possible then this is great However if that isn't possible, I'm ready to use two servers and two clients. (this was the situation up to now) It turns out that when I tested I felt I could see some events of both in the client connected to the single port, however some strings (slice names) were not shown in full and instead as integers, so it looked like it did not work to me. |
I can confirm that because of this change, by default, running multiple processes does not allow one client to observe the multiple server processes that are now in the same port. And there is no easy and reliable way to detect that there is an existing server on a port to try and move to another port. |
You're going to have to help me understand the problem a little more. I'm using the sample program to test this. What I do:
Is that anywhere close to what you're trying to do? |
If the case you require is that you want 2 unique clients to connect to two unique servers on the same machine, using the same port, I'm testing that right now and it doesn't work. If that worked before (wow!) then I wrap that change around a config setting instead of doing in unconditionally. |
I've just removed that commit and tried to test 2 clients/servers and it doesn't work either. |
What I want is either:
Currently (1) is not possible because the web view doesn't have a way of collecting data from multiple process servers. And (2) is almost impossible as there is no way to tell from the server processes which ports are used, since the socket bind never fails. Now I could come up with some complicated shared memory port allocation logic to assign sequential ports to each server. But that's a rather painful route to consider. |
The problem we have is that the server/client relationship is inverted. If the web view was the server, it'd all be quite trivial. |
Right. Sorry for not grokking this problem the first time round but I totally get what you were doing now. I have a few ideas on how to make the same client connect to multiple servers without configuration overhead and I've opened a new issue for that: #134 For now I've turned off reuse and put it behind a boolean setting: 6a37e7f |
I have a program made of two processes. Each of them initialize Remotery w/ its default settings.
Whenever the createGlobalInstance fails with RMT_ERROR_SOCKET_BIND_FAIL, I retry opening it with the next port (increment port inside rmt_Settings by one)
This used to allocate a consecutive port for each process:
127.0.0.1:17815 for the first one,
127.0.0.1:17816 for the second
Now, as I was attempting to upgrade my version of Remotery I end up seeing that both processes claim to have succesfully bound to port 17815. This is on Windows 7.
The old behavior is restored when I revert ca6c662 locally.
The text was updated successfully, but these errors were encountered: