Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Tnslistener dying with 9.2 on Win XP Pro

Re: Tnslistener dying with 9.2 on Win XP Pro

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 20 Jul 2003 23:29:20 -0700
Message-ID: <1a75df45.0307202229.1de66911@posting.google.com>


Holger Baer <holger.baer_at_science-computing.de> wrote

> > Which is the correct behaviour from a TCP server. The listen() thread
> > accept() the connection (which creates a brand new socket for that
> > connection) and then fork() or CreateThread() handinf the socket to
> > that process/thread.
>
> Hey, we're talking windows here! :-) I believe I read somewhere in a metalink
> note that this functionality was not available on windows until nt4 + sp3
> (might have been even later)!

That was likely wrt something else Holger. The Windows Socket API implementation did a decent implementation of Berkely sockets. Which meant that the listen() and accept() calls worked exactly the same way in Win32 as they do on Unix.

> On Unix shared sockets was always the default, I seem to remember from
> the same

This is a bit weird. I will have to look at the WinSock 2.1 API again.. I still can not understand if the "shared socket" is a dinkum shared socket or something else (it sounds like an application thing to me and not like a socket API thing from your explanation).

A socket handle is (in Windows and Unix) the same as a file handle. You can use standard file i/o calls on it. Using Unix INETD some years ago, I wrote a TCP server that did not do _any_ socket calls. The INETD daemon passed the socket handle across (as STDIN and STDOUT if I recall correctly) and I treated these as normal file handles. Worked fine like that.

However, file handles and socket handles are not threadsafe. Which means that if I have 2 threads wanting to write to the _same_ handle (file or socket), I need to have some form of blocking/locking implemented in my code to ensure that only a single thread at a time does an i/o op on that handle (in Windows that is usually done via entering a "critical section" to write to the handle then exiting that section).

Now if this has changed.. it will make things much easier on the developer side (i.e. having a socket as "shareable" and the IP stack making the socket threadsafe).

> However, what with me beeing a youngster on this list, and I've got to
> admit that I'm almost completely on windows (not exactly my personal
> choice ;-) ), my memories might deceive me.

Well, my solution to this problem is coffee. It is with coffee I set my mind in motion... :-) (not that I claim that it does work for me, but it does take the edge of the old lead pipe)

--
Billy
Received on Mon Jul 21 2003 - 01:29:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US