Page 1 of 1

TCPsendToIP Script

PostPosted: Fri Feb 26, 2016 10:42 am
by honsbeek
Hi how to use the next script

Code: Select all
TCPsendtoIP,[ID],[IP],[Messsage]


Is the ID the networkport or TCP Connection ID ( but why the IP then.. )

Thanks

Mark Honsbeek
Live Legends

Re: TCPsendToIP Script

PostPosted: Fri Feb 26, 2016 12:03 pm
by Christian Hinxlage
Hi Mark,

the ID is the tcp connection ID. And you need the ip, when the connection is set up in the connection manager as a Server Multi Client and you want to send the message to just one client.

Best regards

Christian

Re: TCPsendToIP Script

PostPosted: Sun Feb 28, 2016 10:36 am
by honsbeek
Hi Christian,

Christian Hinxlage wrote: the ID is the tcp connection ID. And you need the ip,


Owkey, because inside the widget designer tcp connection you can select the lan-port of the connection thats why you need the ID and IP ?

Re: TCPsendToIP Script

PostPosted: Sun Feb 28, 2016 4:53 pm
by Dennis Kuypers
Hey Mark,

In networking there is always one machine waiting for a connection and another one reaching out to that machine (called Server and Client). If you are the client then you connect to a remote machine identified by the IP. Once the connection is established you can use TcpSend,Id,Msg to send something to the other machine. So far so good.

Now when you create a "Server" connection you can choose between a Single and a Multi server. Single server allows only one connection, so it just works like the client connection (1 to 1). If you choose a "Server Multi" then multiple machines are allowed to connect to your connection id. That means that a TcpSend,Id,Msg sends the message to all connected machines. But how can you send something to only one of these clients and how do you distinguish them? Now this is where the TCPsendtoIP,Id,Ip,Msg comes into play. By being able to pass the IP of the client you can distinguish between the multiple clients on the same connection!

Dennis