Sign in to follow this  
Followers 0
Piyush

How to make script communicate through tcp in lan

4 posts in this topic

Hi! every one....

I wanted to make script which can communicate through lan..but i don't know how to use TCP functions. I knw nothing about tcp.Is there anyone who can explain it to me....with an example or somethng else...PLZ...

Thx..


[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

See that little box in the upper-right with a "Search" button next to it? Type "+TCP +Chat" (without the quotes) in it and hit enter.

Edited by exodius

Share this post


Link to post
Share on other sites

Thx For that..it is a bit difficult but i thnk i can handle it....


[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

hey i followed your advice and learnt it a little bit ..but i am facing a problem..

the things i have learnt are

there is a server and a client..

we can create a server on our ip address and a specific port.. with TCPlisten function..

then run a while loop to accept and receive data..through TCPAccept and TCPReceive

the next script is a client script...where it connects to the server with TCPConnect and sends and receive data o server with TCPReceive and TCPSend.

the client can send and receive data and i know that server can receive data but how can server send data to a client whom it has received data...

i tried this...

server side

TCPStartup();~ create a roooooom
$room=TCPListen("192.168.20.224",6561)
if @error Then  MsgBox(0,'','Error')Else    MsgBox(0,'','done')
EndIf
While 1
$dooropen=TCPAccept($room)
$recivedata=TCPRecv($dooropen,100000000)
if $recivedata ThenMsgBox(0,'',$recivedata)
TCPSend($dooropen,"Thanks")
EndIf
WEnd
TCPShutdown()

and client side

TCPStartup()
$room=TCPConnect("192.168.20.224",6561)
if @error ThenMsgBox(0,'','Not Connected')
Exit
EndIf
$send=TCPSend($room,"pagal pan")
While 1
    $data=TCPRecv($room,100000)
    if $data Then       
MsgBox(0,'messagereceived in client',$data)  
  EndIf
WEnd
TCPShutdown()

but this is not working.... PLZ HElp me out..

Edited by Piyush

[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

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