simultaneous connection help
Germt van de Sande
Posts: 8
Hi, Iam'new with IP connections and need some help.
I need some help to monitor and send from a simutaneos server connection.
I have 20 NI700 and want to talk from 1 to al the others.
The 1 is the server and all the other one's are connecting to it,
It is working with 2 ni700 but i don't know how i can filter out the data what iam recieving to the server..\
IP_SERVER_OPEN(dvIPServer.Port,nIPPort,TCP_IP)
IP_SERVER_OPEN(dvIPServer.Port + 1,nIPPort,TCP_IP)
I use this for open 2 connections, but in the recieve String(data.text). i get data from only the first connection.
And how do i send data(sting) to the client from the first connection and the second.
the data i send is to everyone the same and i do send it by using a timeline., but i wil recieve differend data from all.
thanks
Germt
I need some help to monitor and send from a simutaneos server connection.
I have 20 NI700 and want to talk from 1 to al the others.
The 1 is the server and all the other one's are connecting to it,
It is working with 2 ni700 but i don't know how i can filter out the data what iam recieving to the server..\
IP_SERVER_OPEN(dvIPServer.Port,nIPPort,TCP_IP)
IP_SERVER_OPEN(dvIPServer.Port + 1,nIPPort,TCP_IP)
I use this for open 2 connections, but in the recieve String(data.text). i get data from only the first connection.
And how do i send data(sting) to the client from the first connection and the second.
the data i send is to everyone the same and i do send it by using a timeline., but i wil recieve differend data from all.
thanks
Germt
0
Comments
As to your specific question, do you use the same data event for both server sockets? What it seems you're doing you must have two client systems connect, and unless you can ensure that happens you will not be able to relay from one client to the other. And what if all of the clients want to connect at the same time?
You could also open a server/port specifically for each outside device you want to receive data from and keep them all open all the time. Then you always know where the data is coming from.
If you create an array of your servers you can always use get_last in the DATA_EVENT to determine what server is receiving data. You could use DATA.SOURCEIP to determine where the data is coming from or you can just add a string in the data being sent to these servers to indicate where it's coming from.
Maybe post some more code and someone can give you a little more advice.