A Microsoft platform for building and publishing apps for Windows devices.
Hi, socket connection supports dual-way communication between the server and the client.
You could use TCP or UDP for your scenario.
A TCP (Transmission Control Protocol) socket provides low-level network data transfers in either direction for connections that are long-lived. A UDP (User Datagram Protocol) socket is similar to a TCP socket in that it also provides low-level network data transfers in either direction. But, while a TCP socket is for long-lived connections, a UDP socket is for applications where an established connection is not required. Find more details here: Sockets in UWP
@RichardZhangWicresoftNorthAmericaL-8157 has explained how to keep a long-lived connection and when it will be disconnected. You are able to keep a long-live socket connection but that means your applications are always running on the foreground so it definitely will affect the battery life. In this case, you could delegate ownership of a socket to a system socket broker. The broker will activate your app when traffic arrives on the socket. Then it will transfer the ownership back to your app so your app then processes the arriving traffic. More details are available here: Network communications in the background
Not sure what your specific scenario is but if you need to make sure the communication is reliable, you should use TCP. Otherwise, you could use TCP but there is no guarantee for the reliability.