[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] Q: tcp_connect()
From: |
Aleksander Wysocki |
Subject: |
[lwip-users] Re: [lwip] Q: tcp_connect() |
Date: |
Wed, 08 Jan 2003 23:18:37 -0000 |
> > it seems, that having (void * arg) we can recognize the context
> > of this callback and associate the proper pcb.
> > is this redundant, isn't it?
> > and if not, then why?
>
> Yes, the application could recognize the context by passing the pcb as a
> parameter in the (void *arg) but I think it is more logical to have the
stack
> handle the pcbs.
no. i did not think about passing pcb, but bigger "object"
(i have grown in objects world ;-)
which remembers pcb and generally whole state of connection
(for example such object as "struct netconn")
> The application programmer shouldn't really be bothered by
> this. Also, it gives a more consistent interface - every callback function
> gets the pcb as its second parameter.
actually pcb is really needed only when "accept_callback" is called,
because this "clones" the socket for incoming connection.
in other cases - as you said it is additional method
of identifying "which socket we talk about".
in general i think about something like wrapper, and not application,
and i was confused by this pcb...
but.... anyway, i can use it:
assert(object->pcb == pcb);
;-))))
Olek
[This message was sent through the lwip discussion list.]