Jump to content

TCP question


NicoTn
 Share

Recommended Posts

SERVER:

TCPStartup()
;~ $socket_connect = TCPConnect(@IPAddress1,3147)
$socket_listen = TCPListen(@IPAddress1,3147)
while 1
    $socket_accept = TCPAccept($socket_listen)
    if not $socket_accept -1 Then
        sleep(100)
        $socket_recv = TCPRecv($socket_accept,1024*4)
        if $socket_recv > "" then 
            ConsoleWrite("["&$socket_recv&"]")
;~      MsgBox(0,"",$socket_recv)
        EndIf
    EndIf           
WEnd
TCPShutdown()

CLIENT:

$socket_connect = TCPConnect(@IPAddress1,3147)
sleep(50)
TCPSend($socket_connect,"aan")

the server doenst receive the send command! only when i put TCPsend() in a while ... maybe some 1 got a solution?

thanks in forward

- Nicotine

Edited by Str!ke
while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Link to comment
Share on other sites

You TCPSend and die... When TCPRecv (on the other end) executes... it may get your packet, but is overridden with your death, so the packet is ignored and the death is recorded. Try TCPSend... then have the server respond... then kill the client after the server responds with an OKEE DOKEE.

Lar.

whut uw mean?

while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Link to comment
Share on other sites

You need to have TCPStartUp () on your client as well.

TCPStartUp ()
$socket_connect = TCPConnect (@IPAddress1,3147)
sleep (50)
TCPSend ($socket_connect, "aan")

Off topic: I guess we currently do not have the AutoIt tags for the forum or I can't find them right now.

Edited by Snarg

A little reading goes a long way. Post count means nothing.

Link to comment
Share on other sites

  • Developers

Off topic: I guess we currently do not have the AutoIt tags for the forum or I can't find them right now.

Correct .. but you can type them yourself ... they are working ...:P

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You need to have TCPStartUp () on your client as well.

TCPStartUp ()
$socket_connect = TCPConnect (@IPAddress1,3147)
sleep (50)
TCPSend ($socket_connect, "aan")

Off topic: I guess we currently do not have the AutoIt tags for the forum or I can't find them right now.

i got it only left it out
while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Link to comment
Share on other sites

  • Developers

i got it only left it out

Anything else "you got but left out" ?

Misschien iets duidelijker zijn wat je probleem is en een voorbeeld Posten die je probeelm ook laat zien zou helpen in gewoon Engels.. :P

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Anything else "you got but left out" ?

Misschien iets duidelijker zijn wat je probleem is en een voorbeeld Posten die je probeelm ook laat zien zou helpen in gewoon Engels.. :P

still please some one help me!

i still cant figure it out!

while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Link to comment
Share on other sites

Try this:

$socket_listen = TCPListen(@IPAddress1,3147)
 while $socket_recv = ""
     $socket_accept = TCPAccept($socket_listen)
     if not $socket_accept -1 Then
         Do
         Sleep(10)
         $tick = $tick + 1
         $socket_recv = TCPRecv($socket_accept,1024*4)
         Until $socket_recv <> "" Or $tick = 500
         if $socket_recv <> "" then
             ConsoleWrite("["&$socket_recv&"]")
         EndIf
     EndIf          
 WEnd
 TCPShutdown()
Live and Learn, 'cause Knowledge is Super Power.
Link to comment
Share on other sites

  • Developers

still please some one help me!

i still cant figure it out!

You are obviously not Dutch as I assumed reading the script..

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You are obviously not Dutch as I assumed reading the script..

i am dutch :P and i already fixed but thanks for all your help

Edited by Str!ke
while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...