[comp.protocols.iso.dev-environ] TNetListen and socket descriptors

tebbutt@RHINO.NCSL.NIST.GOV (John Tebbutt) (03/19/91)

Robyne, Brien,

Your exchange about TNetListen and socket descriptors caught my eye, but I
don't really understand the problem or the solution, I'm afraid! 

>>  My problem is I need to get the listen socket number after performing 
>> the TNetListen call.

Pure curiosity: presumably you want to get the socket descriptor *before or
without* a call to TNetAccept - why ?

>Sure, but it is an ugly hack.

Agreed!

>    /* Perform TNetListen.  Socket allocated will be given the same file
>       desc just closed down */
>As I said, it is ugly, but it does work.

What is it about the nature of sockets and the way descriptors are allocated
that enables you to guarantee that this will be the case ? If this is the case
normally, would it also work when setjmp() and longjmp() are used, as they are
in ISODE ?

Thanks in anticipation,

	JT