Where to send UDP packet to?

Discussion to talk about software related topics only.
Post Reply
ckoehler
Posts: 81
Joined: Sat Mar 13, 2010 9:04 pm

Where to send UDP packet to?

Post by ckoehler »

Hello,

I am trying to rewrite a TCP/IP implementation into UDP for speed. I get the connection thing with TCP/IP, so I know how to get the client's IP address.
How do I do that with UDP? I'd like the client(s) to connect to a port and the board to start sending data via UDP then. Can I get a list of connected clients somehow and send the packet to them?

The examples I saw always prompted for an IP address to send to.

Thanks!

Christoph
User avatar
Forrest
Posts: 283
Joined: Wed Apr 23, 2008 10:05 am

Re: Where to send UDP packet to?

Post by Forrest »

Hello Christoph,

This is explained in detail in chapter 13 (UDP Chapter) of the Programmers Guide, located @ \nburn\docs\NetworkProgrammersGuide. You should find all you need to know on both server/client UDP connections.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
ckoehler
Posts: 81
Joined: Sat Mar 13, 2010 9:04 pm

Re: Where to send UDP packet to?

Post by ckoehler »

Thank you!

What are some best practices for working with UDP, like when the destination host isn't available anymore?

Christoph
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: Where to send UDP packet to?

Post by v8dave »

The problem with UDP is that it does not give any indication of a lost destination. There is no connection and confirmation as you would get with a TCP connection. If you need this capability you will need to use a TCP connection and detect the failure to connect.

With UDP you can also do a broadcast so that all devices on the network will see the message. I do this with a weather station so that any device on the network can pickup the message and use it if required. Not ideal for sending lots of fast data though. The weather station only sends a few bytes every 5 seconds.

Dave...
Post Reply