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

allow ipv4 and 6 connections #246

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

andy5995
Copy link
Contributor

(closes #245)

@andy5995
Copy link
Contributor Author

andy5995 commented Aug 13, 2022

At this point (4dd5e12), I can create a host with no crashes, it shows up on play.mg, but it doesn't actually listen for connections:

*ERROR* [2022-08-13 10:52:01] In [/home/andy/src/megaglest-source/source/glest_game/network/connection_slot.cpp::update Line: 1441] Error [Error creating socket (Error: 97 - [Address family not supported by protocol])

@andy5995
Copy link
Contributor Author

andy5995 commented Aug 15, 2022

I squashed all my commits and did a little bit of clean-up.

No crash when clicking "host game", but server can't broadcast (wrong
firewall setup)

So probably the next function to futz with will be
void BroadCastClientSocketThread::execute() on L2199

@andy5995
Copy link
Contributor Author

I squashed all my commits and did a little bit of clean-up.

No crash when clicking "host game", but server can't broadcast (wrong firewall setup)

I see the problem now. I just constructed the socket wrong (and probably removed too much of the old code).

http://www.microhowto.info/howto/listen_for_and_accept_tcp_connections_in_c.html

@andy5995
Copy link
Contributor Author

Still more work to be done, but making progress. I was able to host a game. It published to the master server (only showed the ipv4 address of course), and was able to join the game. Shows here I was connected via ipv6, and the server was listening on ipv6 (I think):

image

image

@andy5995
Copy link
Contributor Author

Still more work to be done, but making progress. I was able to host a game. It published to the master server (only showed the ipv4 address of course), and was able to join the game. Shows here I was connected via ipv6, and the server was listening on ipv6 (I think):

What's more likely is something like this fellow mentioned

https://stackoverflow.com/a/7474120

The reason the address is already in use is because on many IPv6 networking stacks, by default an IPv6 socket will listen to both IPv4 and IPv6 at the same time. IPv4 connections will be handled transparently and mapped to a subset of the IPv6 space.

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

Successfully merging this pull request may close these issues.

Implement ipv6 support
1 participant