Skip to content
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

add "corona" instructions #2

Open
jwaldmann opened this issue Apr 30, 2020 · 5 comments
Open

add "corona" instructions #2

jwaldmann opened this issue Apr 30, 2020 · 5 comments

Comments

@jwaldmann
Copy link

jwaldmann commented Apr 30, 2020

If two clients are behind NAT (of their respective home router), can they still play? E.g., by running a server that has a public IP address?

@jgotoh
Copy link
Owner

jgotoh commented May 11, 2020

It should be possible if the machine that runs the server has a public ip address.

But unfortunately it does not work for me:
First I set up my router to forward a specific port. Then I started a server that should use this port.
When a client then tries to connect to the public ip, it does not work.
It is strange that I can actually connect to the server via netcat by running nc PUBLIC_IP PORT on the client machine.

I ran into the same error some while ago with Cloud Haskell and created an issue [1]. It happened when I tried to connect clients and servers via LAN.
I solved the error by not using the version of distributed-process on Hackage and switching to the current revision in github instead. I will reopen the issue and update it accordingly.

[1] haskell-distributed/distributed-process#346

@jwaldmann
Copy link
Author

switching to the current revision in github

is this in your cabal.project?

@jgotoh
Copy link
Owner

jgotoh commented May 11, 2020

Yes, but unfortunately it does not work in the case of corona, just for LAN.

@jwaldmann
Copy link
Author

I can't even get it to work inside one LAN (behind a home router) (server hangs at "waiting for clients to join", client dies with ".. timeout. No process name at address ..")

wireshark shows packets flowing (between designated server port, 3000, and ad-hoc client port, like 46514) (but not to designated client port, 3001).

I've seen it work in a different LAN (at work). Perhaps something about broadcasting? firewall?

public server with private (NAT) clients probably does not work because the server wants to send pings to the clients so they must be reachable.

server and client must in any case run identical binaries? because messages represent functions in closures by actual machine code addresses - these must be identical on both sides. But as long as we don't send closures?

@jgotoh
Copy link
Owner

jgotoh commented May 14, 2020

I've seen it work in a different LAN (at work). Perhaps something about broadcasting? firewall?

This could be a problem related to some firewall. We use network-transport-tcp, so when setting up connections via TCP works with other programs, I think it "should" work with nt-tcp, too.

You can try running netcat (nc) on your server to test this in your terminal:
nc -l 3000 <- this will open a socket and listen for incoming connections at port 3000

Then run this on the client to connect to the server:
nc IP 3000 where IP is the address of the computer that runs the above command.

When a connection via TCP is set up, the machines then can send text to each other. If there is a problem with your firewall or something else, this would not work.

But as long as we don't send closures?

This is right, we don't send closures, so the binaries do not need to be identical, I tested this some time ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants