|
From: | David Empson |
Subject: | Re: [lwip-users] Setting source port number for UDP send |
Date: | Fri, 11 Dec 2009 12:00:02 +1300 |
With the raw API, the trick is to use
udp_bind() to bind the PCB to a specified local IP address and
port.
It looks like netconn_bind() will achieve the same
thing for the netconn API, and lwip_bind() for the sockets API.
In each case, the bind is done after creating the
PCB with the appropriate "new" call, before doing the first
send/sendto/sendto_if.
Judging from a comment in api_lib.c, it isn't clear
whether you can safely re-bind an existing PCB, so you might need to destroy the
PCB and recreate it if you need to change your source port.
----- Original Message -----
|
[Prev in Thread] | Current Thread | [Next in Thread] |