forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Auto reconnect
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Thu Oct 31, 2002 8:07 am    Post subject: Auto reconnect Reply with quote

Does anyone knows a script which tries reconnecting to a server(using vdsinet.dll), even when the server isn't online?

I made somethin' like this, but it don't works:
Client software
Code:
Title Client
external vdsinet.dll
net socket,vdsevents,1
net socket,auto,1
net socket,port,888
net socket,client

:reconnect
if @not(@equal(@net(socket,status),connected))
 net socket,client
 wait 5
 goto reconnect
end

info Connected!
exit


But when I use this script and I try to shutdown the computer, this program doesn't close.
Of course, because there's a loop in it.

Any ideas or suggestions are welcome,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Oct 31, 2002 9:02 am    Post subject: Reply with quote

Code:
Title Client
external vdsinet.dll
net socket,vdsevents,1
net socket,auto,1
net socket,port,888
net socket,client

:reconnect
if @not(@equal(@net(socket,status),connected))
net socket,client
wait 5
%E = @event()
If @equal(%E,CLOSE)
  Goto %E
End
goto reconnect
end

info Connected!

:CLOSE
exit


Dropping an event routine in there will catch the CLOSE when either you
click the X on your window, or Windows closes it.

-Garrett
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Thu Oct 31, 2002 6:39 pm    Post subject: Reply with quote

Thanx Garret!

Stupid I didn't thought about that Embarassed Embarassed

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Thu Oct 31, 2002 7:56 pm    Post subject: hummm Reply with quote

question


how to make it pop-up a window WHEN it don't connected:

Code:

:CONNECT
  dialog set,STATUS1,@net(socket,status)
  list clear,list1 
  list add,LIST1,Connected.
  list seek,LIST1,@pred(@count(LIST1))
  goto evloop



thanks
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Nov 01, 2002 4:29 am    Post subject: any one Reply with quote

any one have any ideas?


thanks
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Nov 01, 2002 7:20 pm    Post subject: Reply with quote

Do you mean something like this??

Code:
:Evloop
wait event,1
goto @event()

:Timer
if @equal(@net(socket,status),closed)
  dialog set,status1,Not connected
  rem You can also put an INFO in here if you like...
  end
goto evloop
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Nov 01, 2002 8:58 pm    Post subject: hummm Reply with quote

yea but i'am not using a timer: varible so how would i do it then?

thanks
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Nov 01, 2002 9:08 pm    Post subject: Reply with quote

It's not a Timer variable, but Label...

But, you can add something like this:

Code:
:Evloop
wait event
if @equal(@net(socket,status),closed)
    dialog set,status1,Not connected
    rem You can also put an INFO in here if you like...
  end
goto @event()


But, this will only check for a connection if there is an event.
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Nov 01, 2002 9:10 pm    Post subject: humm Reply with quote

sorry for the dumb question what you mean by "if there is an event." please explain

thanks
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Nov 01, 2002 9:12 pm    Post subject: and my looks like this Reply with quote

my code there is this:

Code:

:evloop
  %E = @event()
  if %E
    goto %E
  end
  %E = @net(socket,event)
  if %E
    goto %E
  end
  goto evloop
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Nov 01, 2002 9:20 pm    Post subject: Reply with quote

With 'if there is an event' I meant that there must happen something with your program, like clicking a Button or List or something like that...

Code:
:evloop
  %E = @event()
  if @equal(@net(socket,status),closed)
    dialog set,status1,Not connected
    rem You can also put an INFO in here if you like...
  end
  if %E
    goto %E
  end
  %E = @net(socket,event)
  if %E
    goto %E
  end
  goto evloop


Btw. I've editted your code. It should work proper now...
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Nov 01, 2002 9:57 pm    Post subject: ok but Reply with quote

that don't work that way cuase then i get a msg BEFORE i even hit the "connected" button Sad i wanted it so that AFTER it tries to connected and if it don't then pop-up a window...but this is AFTER i hit the connected button

thanks
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Nov 01, 2002 10:05 pm    Post subject: Reply with quote

Not exactly sure what you're doing here, but...

You may need another loop that only runs after you
hit the "connect" button, that would check the connect
status for a few seconds (and give it time to connect)
before returning to the regular EVLOOP...

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Nov 01, 2002 10:12 pm    Post subject: hummm Reply with quote

hummmm i think i follow what you mean

why can't i just add something like this :

Code:

if @equal(@net(socket,status),closed)



put this under the :connect ( which i have the coded posted above)

thanks
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Nov 01, 2002 10:16 pm    Post subject: Reply with quote

Ya prolly can. Might give it a "WAIT x" first though...

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group