[patch #3] java.net stuff

Bryce McKinlay bryce@albatross.co.nz
Wed Apr 21 04:58:00 GMT 1999


Here's a patch for java.net that implements some of the socket options
methods which are often use by server-type applications.
I am pleased to report that ORBacus (www.orbacus.com) is now working
great on gcj, and starts up quicker and uses a lot less memory than
under the Java VM. I have both libgcj and ORBacus compiled as shared
libs, and the server binaries built against these come out fairly small.
Changelog:
- natPlainSocketImpl.cc (connect) - make sure that the actual localport
gets set when an outgoing socket gets connected
- ServerSocket.java - fix name of ServerSocket.setSocketFactory() (it
wasn't consistant with JDK 1.2 docs)
- fix misc typos
- ServerSocket.java & Socket.java - implement toString() methods
- Socket.java (getLocalAddress) - implemented
- Socket.java - implement socket options methods: set&getTcpNoDelay(),
set/getSoLinger(), set/getSendBufferSize(), set/getReceiveBufferSize
- add java.net.SocketOptions interface specifying low-level
PlainSocketImpl.setOption() & getOption()
- natPlainSocketImpl.cc (setOption, getOption) - native implementation
of socket options methods
In addition, I have implemented the set/getSoTimeout() methods in
Socket.java and ServerSocket.java. However, this option is not
implemented in the native code, and will currently throw an exception.
Actually, it might be better to implement socket timeouts in libgcj
itself rather than trying to set parameters in the TCP stack to do it,
because apparantly the timeouts don't work on most platforms (they
certainly didnt work for me). Kaffe appears to implement timeouts
itself.
Note that you'll need to add the new SocketOptions.java to
libjava/Makefile.am
enjoy
 [ bryce ]


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /