GLBasic forum

Main forum => GLBasic - en => Topic started by: FutureCow on 2010-Feb-04

Title: SOCK_CLOSE followed by SOCK_TCPCONNECT failing
Post by: FutureCow on 2010-Feb-04
I'll write a test program for this tomorrow but here's what I've seen in my program. If I can reproduce it in a very small test program I'll list it as a bug.

If I have a network error (due to a bug in my code  ;) ) both my client and server do a sock_close on the connection.
If, without restarting my program, I try and start the game again, the SOCK_TCPCONNECT returns -2 (a non-blocking socket operation could not be completed immediately).

So I tried putting a sock_close at the top of my client and server functions, just before they do the SOCK_TCPCONNECT and SOCK_TCPACCEPT. This didn't help.

I tried debugging it and put a breakpoint on my SOCK_TCPCONNECT line. After breaking the first connection, I started the server then the client. With the breakpoint it now established the connection. I try that a second time and now (and every time after) it returns -2 again.

Thoughts?
Title: Re: SOCK_CLOSE followed by SOCK_TCPCONNECT failing
Post by: MrTAToad on 2010-Feb-04
Its similar to a problem that I had a long while ago when trying to open a socket after using NETWEBGET...

Gernot fixed that with a non-blocking socket, I think - so I wonder if thats the cause :)
Title: Re: SOCK_CLOSE followed by SOCK_TCPCONNECT failing
Post by: Kitty Hello on 2010-Feb-05
all sockets in GLBasic are non blocking.