简体   繁体   中英

Connecting to multiple devices using Asynchronous sockets in C#

I am writing a ASP.net application to conrtol embedded devices from a web browser.On a user action ASP.net app needs to send command to multiple embedded devices and wait for response from all of them and display successful message to end user. If an error occurs while communicating with one device we need to show it as error message. I went thru asynchronous client example thru call backs. but i am stuck how can I put a loop to open multiple sockets and update the status based on response from individual devices

Use the framework's TcpClient?

Keep the connection's address in a Dictionary and poll using a different thread.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM