Page 1 of 1

Specifying network interface for the listen( ) on MOD54417

Posted: Wed Sep 30, 2015 2:00 pm
by rlupish
For the MOD54417, NNDK 2.7.1, there seems to be no way to restrict the TCP listen( ) (or accept( )) function to "listen" for connect requests on only one or the other of the two Ethernet interfaces. At the moment for us, this is actually an advantage, as we wish to accept a connection on either interface, but I'm curious as to whether other users have found this to be an issue.

What is interesting is that the TCP connect( ) function does appear to optionally allow for specifying the interface to use by supplying the IP address of that interface.

Ron

Re: Specifying network interface for the listen( ) on MOD544

Posted: Thu Oct 01, 2015 9:29 am
by rnixon
For listen and accept, you check which interface it came from in your functions that process them. That's how the multi interface example works to display a web page from one interface or the other. For making a connection, I have not used it, but there is a connectvia() function in the manual that lets you pick one or the other.

Re: Specifying network interface for the listen( ) on MOD544

Posted: Thu Oct 01, 2015 10:50 am
by pbreed
If submit a support request we will send you a patch that adds:

int listen_on_interface(IPADDR addr, WORD port, BYTE maxpend, IPADDR interfaceIpAddress )


Paul