Quick network question

Everything else that doesn't fall into one of the other PB categories.
Kaiser
Enthusiast
Enthusiast
Posts: 118
Joined: Tue Jan 11, 2005 8:36 am

Quick network question

Post by Kaiser »

How do I know if the connection was terminated from the server, without getting an error I can't catch about "ConnectionID is Null!"? or... how do I detect when ConnectionID becomes null so I can execute a CloseNetworkConnection?

Thanks in advance :D
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

Search ClientEvent4 in this forum :wink:
Kaiser
Enthusiast
Enthusiast
Posts: 118
Joined: Tue Jan 11, 2005 8:36 am

Post by Kaiser »

Found this

viewtopic.php?p=113845&highlight=clientevent4#113845

But I can't understand it ... how am I suppossed to use that - if it's a whole FTP thing...? eh, I just need to check when the connection breaks... and I can't understand the code, 4 files, and I have no clue :? ...
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

Could this help?

Code: Select all

ConnectionID = OpenNetworkConnection(ServerName$, Port)

...
...

Closed = 0
Repeat
 If ConnectionID = 0
  CloseNetworkConnection(ConnectionID)
  Closed = 1
 EndIf
Until Closed = 1
Kaiser
Enthusiast
Enthusiast
Posts: 118
Joined: Tue Jan 11, 2005 8:36 am

Post by Kaiser »

I tried, but it seemed to have no effect... :?
User avatar
HeX0R
Addict
Addict
Posts: 1219
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Post by HeX0R »

Kaiser
Enthusiast
Enthusiast
Posts: 118
Joined: Tue Jan 11, 2005 8:36 am

Post by Kaiser »

Hey, that's AWESOME, just what I was looking for - and it works wonders. Thanks a lot you all! :D :D :D
Post Reply