Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 10:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



automatic client reconnection

Discussion on automatic client reconnection within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
Isoline*'s Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 667
Received Thanks: 348
automatic client reconnection

so basically, im trying to create an automatic method that will simply detect if the current client is disconnected, and if so simply, reconnect it, and resume its current ongoing work, the part the im stuck at is how to "reconnect" part.
for starters, i wanted to make it safe, so i just said, well, lets close everything, and i disposed all sockets and aborted all threads, but then i could not reconnect the gateway socket, due to port exhustion, or simply could not connect to the same ip/port, also i couldnt create an entierly new thread and start a client from there, due to "thread state is running or terminated and it cannot restart", well, it seems that im missing something, its a simple task, but im having hard time accomplishing that, glad if someone would help
p.s im trying to re-connect the same server machine obviously over and overc.
Isoline* is offline  
Old 01/04/2016, 20:44   #2

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
you cannot restart an aborted thread, make sure you create a new instance of it
once you detect the client disconnection, you can simply just start the gateway thread back again.
you shouldn't have any problems with ports if you make sure you dispose everything.
sarkoplata is offline  
Thanks
1 User
Old 01/04/2016, 22:12   #3
 
Bizzyyyyy's Avatar
 
elite*gold: 500
Join Date: Jul 2009
Posts: 262
Received Thanks: 543
just use something like
if (!ag_socket.IsConnected())
{
Globals.MainWindow.Log(" Disconnected from the Agentserver.");

Gateway gw = new Gateway();
gw.Start(textBoxIP.Text, textBoxPort.Text);
...

as sarkoplata already said
Bizzyyyyy is offline  
Old 01/07/2016, 16:34   #4
 
Isoline*'s Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 667
Received Thanks: 348
Quote:
Originally Posted by Bizzyyyyy View Post
just use something like
if (!ag_socket.IsConnected())
{
Globals.MainWindow.Log(" Disconnected from the Agentserver.");

Gateway gw = new Gateway();
gw.Start(textBoxIP.Text, textBoxPort.Text);
...

as sarkoplata already said
ok guys thanks, ill try and report back
Isoline* is offline  
Reply


Similar Threads Similar Threads
[Release] Automatic stop-casting in Windows 1.12.1.5875 client
08/16/2015 - WoW PServer Exploits, Hacks & Tools - 2 Replies
Content removed.
[HELP] Reconnection
12/21/2014 - Dekaron Private Server - 9 Replies
Guys i have a little problem some people in our server cant login because of this bug or what ever this is http://fs1.directupload.net/images/141214/yi9wchz t.jpg can someone tell me how to solve this ?
( Help )Perfect World Client closed automatic
04/17/2010 - Perfect World - 0 Replies
hi guys i search for something when i play Perfect world and goin to watch Move or do anything in my PC there`s 2 option can happend the client is Freeze .. the client closed automatic after like 30 min can anyone help me to fix this .. need to do some work beside playing the game



All times are GMT +1. The time now is 10:51.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.