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

Fallback to IPv4 if cannot open UPD or TCP socket #2640

Merged
merged 1 commit into from Nov 17, 2019

Conversation

@o01eg
Copy link
Contributor

o01eg commented Nov 11, 2019

Fixes #2626

@o01eg o01eg added this to the v0.4.9 milestone Nov 11, 2019
@o01eg o01eg requested a review from geoffthemedio Nov 11, 2019
@o01eg o01eg self-assigned this Nov 11, 2019
@o01eg o01eg force-pushed the o01eg:fix-2626 branch from 971122a to 0a1d4b7 Nov 14, 2019
@o01eg o01eg changed the title Listen UPD socket only for multiplayer game Fallback to IPv4 if cannot open UPD or TCP socket Nov 14, 2019
@geoffthemedio

This comment has been minimized.

Copy link
Member

geoffthemedio commented Nov 17, 2019

With this applied, attempting to get info from the server over UDP crashes it, whereas it works in master.

In Python while a server is running on localhost:

import socket
UDP_IP = '127.0.0.1'
UDP_PORT = 12345
MESSAGE = 'CurrentTurn'.encode('utf-8')
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(MESSAGE, (UDP_IP, UDP_PORT))
data, addr = s.recvfrom(1024, 0)
print(data)
@o01eg o01eg force-pushed the o01eg:fix-2626 branch from 0a1d4b7 to a9d3684 Nov 17, 2019
@o01eg

This comment has been minimized.

Copy link
Contributor Author

o01eg commented Nov 17, 2019

@geoffthemedio I've missed point Listen shouldn't connect again. Fixed it.

@o01eg o01eg force-pushed the o01eg:fix-2626 branch from a9d3684 to 34a5328 Nov 17, 2019
@geoffthemedio geoffthemedio merged commit 58f0b8e into freeorion:master Nov 17, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@o01eg o01eg deleted the o01eg:fix-2626 branch Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.