Subj : Sync/Door Programming Question To : kmcmahon70 From : Digital Man Date : Mon Sep 19 2005 01:12 pm Re: Sync/Door Programming Question By: kmcmahon70 to alt.bbs.synchronet on Mon Sep 19 2005 12:55 pm > From Newsgroup: alt.bbs.synchronet > > Hi Folks > > I've been looking at the door32.sys specs supported by Synchronet and > have found a question regarding the socket handle parameter: > > After sync has written the socket id to the door32.sys file, how is the > socket released for the door to use? Inheritance of the socket handle? The socket description written to the door32.sys file was created using DuplicateHandle (in the case of Win32), so yes, the door is inheriting a duplicate socket descriptor for the same socket. Synchronet handles closing this duplicate socket descriptor when its not needed. > Playing around with my windows box I find that I can retrieve the > socket and perform the needed operations, but when I am ending my door > and want to return to the BBS what is the proper way to release the > socket? Nothing. Don't close it. :-) > Winsock specs claim that WSACleanup() must be called once per each call > to WSAStartup()... this call, however, seems to destroy the socket I > picked up from door32.sys and thus when Sync gets it back it appears as > if the caller disconnected. Right, don't call WSACleanup(). :-) > If I don't call WSACleanup() at the end, it works well but I have a > feeling this is the wrong/bad way to do this. That's the correct way. That's how the Synchronet XSDK handles socket I/O doors. :-) digital man Snapple "Real Fact" #37: A snail breathes through it's foot. .