Class OncRpcTcpSocketHelper


  • public class OncRpcTcpSocketHelper
    extends java.lang.Object
    Wraps JRE-specific networking code for TCP/IP-based client sockets. So much for compile once, make it unuseable everywhere. Why could our great Sun simply not get their socket class straight from the beginning? The BSD socket API has been around since long enough and that real network applications need to control certain aspects of the transport layer's behaviour was also well known at this time -- looks like the one exceptions was -- and still is -- Sun, and the second one is MS.

    Sun always toutes Java as the perfect network "whatever" (replace with buzzword-of-the-day, like "programming language", "operating system",...) and especially their support for the Web. Sweet irony that it took them until JRE 1.3 to realize that half-closed connections are the way to do HTTP/1.0 non-persistent connections. And even more irony that they are now beginning to understand about polled network i/o.

    The following JRE-dependent methods are wrapped and will just do nothing or return fake information on old JRE plattforms. The number after each method wrapper indicates the first JRE version supporting a particular feature:

  • setSendBufferSize() -- 1.2
  • setReceiveBufferSize() -- 1.2
  • The following methods have been around since JDK 1.1, so we do not need to wrap them as we will never support JDK 1.0 -- let it rest in piece(s):

    • getTcpNoDelay() / setTcpNoDelay()
    • getSoTimeout() / setSoTimeout()

    In order to support connect() timeouts before JDK 1.4, there's now a connect() method available. It is more than just a simple wrapper for pre JDK 1.4.

Version:
$Revision: 1.3 $ $Date: 2007/05/29 19:45:46 $ $State: Exp $ $Locker: $
Author:
Harald Albrecht