Comments (8)
There is actually most code to handle this already. Disconnections are detected, but not always handled correctly yet.
Example, this code is disabled right now:
https://github.com/daid/EmptyEpsilon/blob/master/src/screens/mainScreen.cpp#L40
from emptyepsilon.
Looks like the send disconnect for clients is working. The client with autoconnect goes back to the waiting for server screen.
Not sure if I should open a new issue for the clients not wanting to auto-reconnect after the server has went away and came back. You have to exit EE completely on the server and restart it to have the autoconnect clients connect again. Server and client was tested on the same machine.
from emptyepsilon.
Might take a while for clients to re-connect after an auto connect. If it takes longer then 30 seconds, then there is a bug there.
from emptyepsilon.
Looks like a bug. The autoconnect client looks like it's trying to connect, as it briefly changes from "Searching for server..." to (what I'm guessing is) connecting to server, and then back to Searching.
I ran it for several of minutes without the client re-establishing connection. When I shutdown & exit out the program on the server while the autoconnect client is still running, and then start EE again then create a server, the client autoreconnects fine.
from emptyepsilon.
Think I might have figured out the issue I am having. Looks like the connection to the server from the client is still in TIME_WAIT status. Which is causing the Server not to be able to use the same TCP Port when run on the same machine as the client. I only noticed this when I tried to run it as a headless server since the Game window wasn't covering my terminal.
Error from the command line:
Failed to bind listener socket to port 35666
[ERROR] Failed to listen on TCP port: 35666
output of netstat -tapn when exiting the server
tcp 0 0 10.0.2.15:35666 10.0.2.15:59745 TIME_WAIT -
Once the connection finally clears out, it will allow me to restart the server.
Most people will probably not notice this problem unless they run the server and the client on the same machine. This is how I do my testing after you do a new commit.
from emptyepsilon.
Just tested from Linux (VM guest) to Windows 7 (VM Host): it auto-reconnects fine.
from emptyepsilon.
The TIME_WAIT for server sockets is a annoying thing. It does solve itself after 2 minutes, and you can disable it on linux at a system level (but you shouldn't)
Normally you can hack around this by setting the SO_REUSEADDR flag on the listen socket, but SFML does not support this.
Problem is that EE does not handle this gracefully yet. As it should tell the user that it cannot start the server, instead of silently doing "nothing" and act like there is a server.
from emptyepsilon.
Should be fixed in latest, clients properly disconnect, and you no longer need to close the server to change scenario.
from emptyepsilon.
Related Issues (20)
- [Ship categories] Freighters and Ktlitan ships should get their own category. HOT 3
- [GM interface improvements] GM input dialogue and Add ship filtering HOT 3
- [gm/ObjectCreationView] Add icons to ship lists HOT 1
- [gm/ObjectCreationView] Allow filtering/sorting ship lists HOT 2
- [AI] CpuShips with 0 max_impulse_speed can set infinite impulse_request values HOT 3
- [GuiAdvancedScrollText] Large number of entries degrades render performance HOT 1
- [GuiScrollbar] Draggable bar size has no lower bound HOT 2
- [GuiScrollbar] Scrollbar bottom range can be positioned below bottom arrow, where user can't scroll HOT 1
- [GuiScrollbar] Arrow scroll amount can be too small HOT 1
- Warp Jammer is invisible in 3D views HOT 1
- [ShipsLogControl] Log might not update if first entry text is the same as the latest
- [Planet] Collision radius isn't updated with object radius
- [scriptdocs] Path references are incorrect
- [docs] Document resource pack creation and usage
- Alpine-linux compiling HOT 9
- Package EmptyEpsilon via Flatpack and publish on Flathub HOT 9
- After building from source running fails due to no config HOT 5
- Pressing delete while at the end of a text entry box crashes the game HOT 2
- [tweak] Docking services toggles are confusing if ship doesn't have any DockClasses HOT 2
- Enhancement Request - Missile Tube Status getter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emptyepsilon.