Jump to content
Sign in to follow this  
Wb-FreeKill

Do..Until Connected?

Recommended Posts

DO

$socket = DLLCall("au3xtra.dll","int","TCPConnect", "str", $g_IP, "int", 65432 )

Until NOT @ERROR

msgbox(0,"test","Connected")

Why are the msgbox poping up when the server aint open... It should try to connect until it finds thr server, and then run the script.

Share this post


Link to post
Share on other sites

Search()

Func Search()

DO

$socket = DLLCall("au3xtra.dll","int","TCPConnect", "str", $g_IP, "int", 65432 )

Until NOT @ERROR And $socket[0] > -1

$socket = $socket[0]

EndFunc

________________________

Lots of functions

_________________________

windows()

Drives()

Complete()

While 1

If $ret[0] < 0 Then

msgbox(0,"test","server discet")

Search()

EndIF

; Server Disconnected... we Outty...

;--------------------------------------------

WEnd

Okay, this is my script... when it starts, it will run in the Do..Until searching for server.. when server conencts, it will run the functions, and enter the While. If server disconnects, it should return to Search() function, and search for server.. that works fine.. but it wont run the other functions before the while again? :lmao:

How come

Share this post


Link to post
Share on other sites

Maybe you could tell me why this aint working then?

If $msg= $ConnectBtn Then

If $ConnectedSocket = -1 Then

;msgbox(0,"test","hej")

$ConnectedSocket = DLLCall(@Tempdir & "\au3xtra.dll","int","TCPAccept", "int", $MainSocket)

If @ERROR Or $ConnectedSocket[0] < 0 Then

$ConnectedSocket = -1

Else

WinSetTitle($GOOEY,"","My Server - Client Connected")

$ConnectedSocket = $ConnectedSocket[0]

EndIf

EndIf

If client is running, and i press the button, nothing happens, and if i write GUICtrlread($connectBtn) It will connect no matter i press the button or not!?! :S

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...