Alex
Alex

Reputation: 63

Linux, can I specify port for outgoing udp packet?

In one linux process there are several opened udp sockets for sending, each with no bind(). Is there any way to specify port for outgoing packet? Or raw sockets are the only way to do so?

Clarifying one moment: I have to have several separate sockets, so bind() is not an options.

Thanks, Alex.

Upvotes: 0

Views: 439

Answers (1)

user207421
user207421

Reputation: 310850

Just call bind(). That's what it's for.

Upvotes: 2

Related Questions