Pawan Joshi wrote: > > From one of the .h file : "File descriptors may be layered. For > example, SSL is a layer on top of a reliable bytestream layer such as > TCP." > > Could someone please provide some pointers on why/how of layering of > file descriptors in Mozilla?
http://www.mozilla.org/projects/nspr/reference/html/priofnc.html#19749 http://www.mozilla.org/projects/nspr/reference/html/prlayer.html The concept is loosely based on System V STREAMS. The idea is to make layers in a protocol stack modular. > It seems, we can have two layers for a secure socket i.e. one layer > while creating the socket and another while making it a secure one (by > calling SSL_ImportFD ). Yes. You can have many more than two. PSM routinely has its own layer above SSL, and I think there is also a layer between SSL and the socket layer when using SOCKS. That's 4 layers right there. > Also wondering when do we decide to use the corresponding method of a > lower layer. Is it only when the method is not implemented in the > layer? Each layer makes that decision. Each layer implements all the methods in the PRIOMethods table. The implementation may simply call the implementation in the next lower layer, or it may do some other things and conditionally call the lower layer, etc. > Thanks & Regards > -Pawan -- Nelson Bolyard Disclaimer: I speak for myself, not for Netscape
