[2541] in java-interest
Re: Ugh. These Sockets...
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Wed Oct 4 04:52:04 1995
Date: Mon, 2 Oct 1995 18:36:49 -0700
From: avh@jakarta.Eng.Sun.COM (Arthur van Hoff)
To: pmtyma@mailbox.syr.edu
Cc: java-interest@java.Eng.Sun.COM
Hi Paul,
> The JDK's implementation for socket usage certainly is built to confuse.
> I don't have too much problem with the SocketImpl or SocketImplFactory
> ideas (someone been reading Design Patterns?), but given that I am to
> subclass the abstract SocketImpl, I'm a bit taken back. First off,
> that is quite a big class to say, 'oh btw, implement ALL these methods'.
> Whilst looking for some semblence of an example I run across
> PlainSocketImpl.java in the source lib. Yeah! a subclass example!
> Boo! Half the important methods are native?! Can't this magic be done in
> Java?
It would be possible to implement a TCP/IP stack in Java, but it is
kinda beyond the scope of our project.
Anyway, you should not be subclassing SocketImpl unless you want to
provide your own socket implementation in which case you will have to
write some native code.
> So, just for yuks, lets say I wanted to per se 'use' this socket class.
> I am quite willing to put in the work to subclass the SocketImpl class.
> How the heck do I this? (Please no one say go use sun.net.NetworkServer, etc.
> yes I know thats an easy way out but it would seem the official API should
> be usable too)
>
> Any help, CODE, suggestions, CODE, comments, or CODE would be appreciated.
I have no idea what you want to do. If you want to use socket, then you
should use java.net.Socket and stay away from SocketImpl. It is an
implementation class.
Have fun,
Arthur van Hoff
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com