TM wrote:
> Hi Uwe,
>
> I'm opening a port for reading.
>
> I cannot set the NIC with 'udp_open'. So, how can I be sure that I am only listening to data arriving from a specific NIC? How does the OS know which NIC I want to get data from?
>
> Or is TCL listening to the specified port on **all** NIC?
yes, that is the default config.
You will see all datagrams to the port you are listening on on all interfaces.
>
> I use the following code to get the UDP comms going:
>
> # open socket
> if {[catch {udp_open $port} channel]} {return -code error $channel}
>
> # configure channel
> fconfigure $channel \
> -buffering none -blocking 0 \
> -encoding binary -translation binary
>
> # and start listening
> fileevent $channel readable [list PacketServer $channel]
>
> vwait running
Looks like that should work.
apropos: what OS/system are you using?
uwe