Good evening, Simon!
Thank you for your hint! I changed it the way David mentioned, using
another netconn_bind before sending the first block over the connection
... and it works. I was a little bit confused about the netconn_bind,
because i use this after first init of the connection to get a listener
on this port ... not thinking that using it a *second* time will set
the source port. But great ... and i'm for sure not thinking about
using any other stack :o))
A good night to all,
Marco
address@hidden schrieb:
BIG FAT WARNING!
This is *totally* unsupported! Doing this, you risk:
a) threading issues: the raw API structs and functions may only be used
from tcpip_thread, while you are changing a raw API struct from your
application thread (the udp pcb).
b) The members of both struct netconn as well as struct udp_pcb are
*not* part of the public API, meaning they are bound to change without
you noticing (and without us announcing it). You can access them, I
know, but that doesn't mean you should use them like that.
Once you leave lwIP and work with another stack (although that will
never be the case, I hope *g*), you face the same problem again.
Therefore, you can just do it right now and use bind() (whether it be
lwip_bind() for sockets, netconn_bind() for netconns or udp_bind() for
raw API udp pcbs). David suggested the correct functions, so no need to
mess around in lwIP internal structs.
|