|
Post by u9 on Mar 24, 2008 15:54:26 GMT -5
I get an "Address already in use" error from net.getlasterror() when i try to net.StartClient() on in a program that has once been a server. Even though i call net.CloseConnection(). How do I stop a server and free all resources?
Let me know if you would like my code.
|
|
|
Post by Guilect on Mar 24, 2008 18:26:33 GMT -5
Now why do you go and do a silly thing like start a server then stop it and then start it as a client Everything works fine when I do things in a way in which everything works fine. CloseConnection should do it but apparently not. I will check it out.
|
|
|
Post by u9 on Mar 24, 2008 19:42:09 GMT -5
hehe, well sometimes you want to host, and other times you just want to join some one elses game
|
|
|
Post by Guilect on May 5, 2008 18:48:40 GMT -5
I did some testing and I think this is solved. The solution made it necessary to make manditory the use of 2 new Net objects commands. Initialize and Terminate.
So for the situation that U9 had you would do so (for example):
Net.Initialize Net.StartServer 7777, Net.GetMasterServerIP, 2000 system.debugPrint " start server " & net.getlastError net.closeconnection system.debugPrint " stop server " Net.terminate msgbox("start some server") Net.Initialize Net.startClient 7777, Net.GetMasterServerIP, 2000 system.debugPrint " start client " & net.getlastError net.closeconnection system.debugPrint " stop client " Net.terminate
So, Net.CloseConnection should stop any communications, while Net.Terminate acually destroys the Net object and you will need to Net.Initialize to create a new again.
I will try to get the help file updated and a new release out soon.
|
|
|
Post by u9 on May 10, 2008 5:57:48 GMT -5
Cool. I will try it out as soon as i have some free time again. Right now i am rather busy with my game production.
|
|
|
Post by Guilect on May 10, 2008 9:37:17 GMT -5
Hi U9, I just looked over your game development info, looks very thorough. This should keep you off of the streets for awhile. Will be looking forward to trying a beta or demo sometime.
|
|