Sign in to follow this  
Hedanito

Winsock Multiprocess Issues

Recommended Posts

Hedanito    134
So I have this really weird bug with I have been trying to fix for the past 3 days.

I basically have 2 applications, one is the game, the other one is an editor.
I connect them together so I can send data around.
The game has a listening socket and the editors just try to connect to it every once in a few seconds.

This works fine, but there is this really weird and specific bug.
I have the option to launch an instance of the editor from the game.
When I do this (using anything from sytem to CreateProcess, I tried them all), the editor launches and connects as expected.
When I then shut down the game the editor loses connection.

But here is where it gets weird.
For some reason the next time it tries to connect, it succeeds.
Even though the game is not running.
Then it disconnects because it doesn't receive any ping message (because there is no game to send them) and thinks that it has timed out.
After that, it reconnects again.
And it just keeps doing this over and over.
And this just happens when I start the process from the game.
When I launch the editor seperately, this does not happen, and everything works perfectly.

So I hope that any of you have any idea what is going on here, because I really don't know anymore.

Share this post


Link to post
Share on other sites
Hedanito    134
After some more debugging I think I have found at least where it goes wrong (but still no idea why).
For some reason the sockets keeps hanging around when a process is launched from the game.
I tried starting notepad from the game, and then shutting the game down, and everything will think that the socket still exists.
The moment I shut down notepad however everything goes back to normal.
Now I played around a LOT with shutting down the socket.
I tried pretty much every way and step in between to shut it down, but none of them seem to fix the problem.
Even resetting everything everywhere, including calling WSAStartup and WSAShutdown does not seem to help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this