Pages

Wednesday 25 July 2012

Using UDP sockets to connect a Windows 8 Metro style app to a .NET Micro Framework device: Part 3

Using UDP sockets to connect a Windows 8 Metro style app to a .NET Micro Framework device: Part 1
Using UDP sockets to connect a Windows 8 Metro style app to a .NET Micro Framework device: Part 2

In part 3 post, I show how to have bidirectional UDP communication: The Win8 Metro style app will send messages to the Gadgeteer device which responds with ACKs.

About two-way communication


UDP socket communication involves a pair of endpoints. Each endpoint is made up of an IP address and a port. In my example, the addresses and ports are as shown in this graphic:

Using UDP sockets to connect a Windows 8 Metro style app to a .NET Micro Framework device

When the Metro style app sends a message, it picks a port number. In the examples here, the port is 56553. The number itself isn't all that important, and isn't something you'd typically try to control. The destination port, however, is more important - it needs to be known. As long as the originator knows the destination port, you can have two-way communication, as the destination is informed of the originating port and IP with each message.

Read full article here

No comments:

Post a Comment

Web Informer Button