RL-ARM: Allocation then release of listening socket

I am trying to produce a module for providing a listening socket.

One requirement of this module is to release the socket when it is no longer required.

So the code does something like this:


int Skt;

Skt = tcp_get_socket( TCP_TYPE_SERVER|TCP_TYPE_FLOW_CTRL, 0, 30, Callback);

...

// Remote client access the socket - And then closes the connection

...

// A call to tcp_get_state(Skt) returns TCP_STATE_LISTEN

if (!tcp_release_socket(Skt))
  // Failure - And I don't understand why

My problem is that the attempted release of the socket always fails.

When I carry out a similar sequence for a TCP_TYPE_CLIENT (as opposed to the TCP_TYPE_SERVER) the release of the socket is successful.

Can anyone tell me, am I missing something? it surely is possible with this library?

Parents Reply Children
More questions in this forum