Sign in to follow this  
Followers 0
NicoTn

TCP question

10 posts in this topic

#1 ·  Posted (edited)

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]

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

still please some one help me!

i still cant figure it out!

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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]

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  
Followers 0