I'm have implemented WCF (nettcpbinding) Windows Service to talk to another device which is connected with my system. I want to connect many devices (all the devices will write data on the same port) into my machine and process the data that I receive and also respond on the same stream that gets established. Is it possible to listen and respond multiple devices? Will that be taken care by Framework or I should maintain any queue in between.
1 Answers
As long as you don't use persistent connections, you should be OK. NetTCPBinding allows for persistent connections, but default behavior is that a) the client connects, b) does its business, c) gets a response and d) the WCF service recycles the connection making it ready for the next request.
And WCF automatically queues waiting requests, so you shouldn't need to create a queue to process any waiting requests.
Having said all that, if the "many devices" are performing different tasks (one is uploading pictures, another downloading addresses, another logging transactions, etc.) then you might consider different end points based on each separate type of task, like http;//MyServer:8001/Uploadphone and http;//Myserver:8001/Tranactions.
It's up to you. But, bottom line, multiple devices won't be a problem so long as you aren't persisting connections.
Here's a link to a related question: Does WCF NetTcpBinding provide a persistent connection?