lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Removing the restriction on number of sockets


From: Joan Lledó
Subject: Re: [lwip-devel] Removing the restriction on number of sockets
Date: Mon, 7 Aug 2017 23:19:22 +0200

2017-08-07 22:16 GMT+02:00 address@hidden <address@hidden>:
> The proposal doesn't look too bad overall. However, I'm not sure using a
> linked list is the best solution. If you implement this to not have the
> total number of sockets limited, a linked list might hurt...
>

Yeah, I don't like it neither, but I need a way to find a lwip_sock
from a socket number, and iterating a linked list was the first idea
that came to my mind. Any suggestion?

> An I wouldn't limit the "open socket count" functionality to
> MEM_LIBC_MALLOC. We do have a heap which can be used for this.
>

Wouldn't that limit the amount of sockets due to MEM_SIZE?

> Another thing you need to consider is FD_SET, which is currently implemented
> as bit field.
>
> Cheers,
> Simon
>
> Joan Lledó wrote:
>>
>> I'm porting LwIP to the Hurd as my Google Summer of Code project. In
>> our port, we're using the sockets API but we need to remove the
>> restriction of having a maximum amount of sockets.
>>
>> I'm looking for advice on how to do this in a way it's acceptable for
>> upstreaming. This is my proposal:
>>
>> - Add a new lwipopts.h macro to disable the restriction
>> - Allow enabling that macro only if MEM_LIBC_MALLOC is enabled
>> - When this new macro is disabled, just use the current code with the
>> static array of sockets
>> - When this new macro is enabled
>> - Add new pointers to struct lwip_sock to make it a linked list
>> - Declare "sockets" as a pointer to struct lwip_sock pointing to the
>> first element in the linked list
>> - Use mem_alloc() to allocate new sockets
>> - Modify alloc_socket(), free_socket(), get_socket() and
>> tryget_socket() to deal with the list
>>
>> What do you think?
>>
>> _______________________________________________
>> lwip-devel mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/lwip-devel
>>
>
>
> _______________________________________________
> lwip-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-devel



reply via email to

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