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: 17 Jul 2003 00:50:30 -0700
Message-ID: <1a75df45.0307162350.6be27bcb@posting.google.com>


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

>
> The default behaviour is that the listener receives the client request. The
> listener then contacts the oracle process which in turn spawns a new socket
> and returns the socket to the listener. The listener gives the socket
> address back to the client and > the client initiates a new connection to
> that socket.

Sheez..what an arse about way of doing it. The accept() returns a new and dedicated socket to talk to the client. The socket that is bound to the port is only used for listen() and _nothing_ else.. or that's how I've written my TCP server code since always.

As for sharing a socket.. multiple threads (within the same process) can use the same socket. As long as they do a critical section when accessing the socket handle (reading or writing) as the socket itself is not threadsafe. There's no need to share the socket.

Sharing sockets is in fact sharing a port (ito of the socket API). That way more than one socket handle can be bound to a port. Simple example. UDP server and UDP client sit on the same box. Both use port 49000. If the UDP server does not allow the port to be shared, the client will not be able to read from the port (in fact, if the client starts first it can open the port in share mode and the server can still access it without it having to explicitly share the port).

Thus this Oracle "shared sockect" is in fact an application thing and not a specific socket setup call that is made (reason for my question).   

> (Un)fortunately this is exactly what a firewall blocks.

Yep.

> So with shared socket the listener spawns the socket for the client
> connection and hands it over to oracle.

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.

> HTH
It did. Thanks. Methinks that this is a sign of very old legacy mainframe networking code that has never been removed from Oracle. TCP programming on mainframes in the old days was a bitch at times. Never did like the DCAM (Direct Communication Access Method) interfaces used... And I've never worked on one that supported the Berkely socket interface until the mid 90's.

--
Billy
Received on Thu Jul 17 2003 - 02:50:30 CDT

Original text of this message

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