7 years, 8 months ago.

EthernetInterface Network reconnection

I am using the following =: MBED-os build 2742:5faf4b2 HW: FRDM K64f

Once I have disconnected the network using disconnect() I cannot reconnect it and establish a socket.

I have declared: EthernetInterface net; TCPSocket socket;

I establish a network connection using net.connect() I then set up a TCP socket using socket.open() I use the socket to send and receive data I close the TCP socket using socket.close() I disconnect the network using net.disconnect(); I then reconnect the network using net.connect() - this is successful I then try to open a socket: socket.connect() - this returns an error -3005

I expect this is a bug in the driver.

1 Answer

7 years, 8 months ago.

You'll need to socket.open(&net) before calling socket.connect().

I have tried it with the modification above and mbed-os at revision 5faf4b2, and I am not seeing this issue.

I am not sure about your version of mbed-os, though the part after ':' looks the same as mine. We don't release mbed-os on the developer site, so the commit hash will be one without ':' in the style of git. Can you either post the URL to your code or the URL of the place where you imported mbed-os? Can you also post a correct hash? You should be able to view it in the online compiler by selecting the mbed-os folder, then pressing the revision button.

Accepted Answer