[openbeosnetteam] Re: Missing stuff

Oliver Tappe <openbeos@xxxxxxxxxxxxxxx> wrote:
> I have just grabbed UDP as a starting point for myself and when I 
> looked at 
> the existing structures I have noticed that there seems to be no 
> notion of 
> protocol control blocks (PCBs). While UDP can certainly get away with 
> the 
> data provided by net_socket, I suppose TCP surely will need to extend 
> the 
> per-socket (well, per-connection) info in order to keep connection 
> state.
> 
> Should we introduce some kind of protocol_state structure and a 
> pointer to 
> such a beast in net_socket (the pointer would usually be empty for 
> many 
> protocols, but could be used for TCP)?
> 
> Or is there some other way this data can be kept that I am just 
> unable to see?

There is a per socket structure already, in case of TCP it's called 
tcp_protocol right now.
It might not be very obvious, but init_protocol() is called for every 
socket that is created.
But keep in mind that when you receive data, you don't have that 
context available.

Bye,
   Axel.


Other related posts: