lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: [lwip] reusing a socket from runtime to runtime


From: Kieran Mansley
Subject: [lwip-users] Re: [lwip] reusing a socket from runtime to runtime
Date: Thu, 09 Jan 2003 01:48:16 -0000

On Tue, 19 Nov 2002, Jimi Simpson wrote:
> 1) I could periodically poll the connected clients from the server app
> and drop any clients that do not respond.

Sounds like a good idea.

> 2) I could simply open a socket, send data and close the socket for each
> message. This is obviously at a significant overhead and loss of power
> during any communication will bring about the same problem.

It would (should?) work, but has disadvantages like you say.

> 3) I could re-implement the section of code that generates a port number
> to provide one that is random and maybe this is what I should do.

This wouldn't work.  There is a small probability that your randomly
generated port number would be the same as the one you've just used, and
so you'd have the same problem.  You need something that generates a
sequence of port numbers, so each time you use the next one.

> QUESTION:
>
> Does anyone have an identical or similar experience of a situation like
> this and if so could you shed some light on possible ways to overcome or
> work around the problem. Maybe I am just missing some understanding of
> sockets due to my limited experience but any help will be most
> appreciated.

I don't, and most people tend to use lwIP without the sockets interface as
it's rather slow and increases resource usage.  This means it's not been
heavily tested, although Paul Sheer I think did a fair bit of testing, and
developed his own sockets interface for PaulOS, so you might want to take
a look at that.  I have developed another sockets interface which uses
lwip's raw interface directly, and so achieves much higher performance,
but it's not available publically yet as it requires some fairly major
changes to the structure of lwIP.

Sorry I can't be of more help.

Kieran

[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]