03-08-2011 05:22 AM
I am working on one server- multi client tcp/ip application in which server and all clients can send and recieve data.... I mean single server handles full duplex communication with all clients simultaneously.....To do that is it required to have seperate port number for seperate clients...I mean server communicate to client 1 with port no.2041 and for client 2 it is 2042...
Is there any examples to handle this scenario? I have seen example of muliple connection in find examples but I am not able to communicate ...
Advise.....
03-08-2011 06:40 AM
Hi MSD100,
no you can use the same port for every connection. It's like all user of the ni.com forum use port 80 to see the webpage.
Where do you have problems with the example from the example finder?
Mike
03-08-2011 11:27 PM
Hi Mike! Thanks for your reply...
I am trying to send and receive data between server and client by modifying example vi of Multiple connection server-client.....but I am not able to get working.....another thing is how I can differentiale between seperate client if I use same port?
I have seperately done server-client coomunication using simple server-client examples but not able to do with using multiple server-client example...
thanks..
03-09-2011 01:40 AM
Since the example works since about 20 years for all kind of people you must have done something wrong when doing modifications. From your "very" detailed description of what you have modified, it is absolutely impossible to even guess what might be wrong. Of course you can try to describe it, but putting up the VI as attachement is something that works better, is faster, and should have been done in the first post already.
As to your identification of the client when connecting to the same port. You'll have to look a little bit closer and you will notice that the node TCP Wait on Listener returns a network address of the connecting remote end. You can use that for identification and if you need to have that information available later you need to store that address in a way that you can easily retrieve it based on the connection refnum.
03-09-2011 02:43 PM
You would need to modify the example that I provided to spawn a separate task for each client connection. The main server would wait on the listener for a new connection. When on arrives spawn a task to process that connection and immediately go back to listening for new connections. If you need to broadcast data from the server to all clients you could use queues, a notifier or user events to send the data to the client tasks.
03-09-2011 11:04 PM
thank you all for replies....I am working on vi...I will attach it later if facing problems......
03-25-2011 12:09 AM
I tried some modification in Multiple server-client example....First I wanted these examples to transfer data bidirectional....so I modified the vis but somehow its not working....I am attaching it..its just one server and one client currently...
03-25-2011 12:56 AM
When you say something is not working, and you are looking for help, you should tell us How it is not working. I don't know what kind of help you expect with a statement that provides no information.
03-25-2011 11:27 PM - edited 03-25-2011 11:31 PM
A big sorry for that.......
Actually I want to make one server and multi client application in which server and clients can communicate both way simultaneously or in sequence......
Initially I performed one server - one client bidirectional communication and it worked....then I moved to Multi client....
So I looked into the example of multi client in labview....my first attempt was to establish bidirectional communication in that example between server and only one client....so I modified....but it is not working properly data is not passing both ways...I attached that files above...
Thanks in advance for your concern....
03-30-2011 02:25 AM
Is it logical to use queue for multi-client application ...so that each client is enqueued and attended one by one.....