Roman Kennke wrote:
I am confused how this method is supposed to work. It has a boolean
parameter that is documented to be used to distinguish between datagram
and stream sockets. However, it is only used by Socket and ServerSocket,
so I guess it must always be a stream socket? But it gets worse. The
PlainSocketImpl.create() calls socketCreate() with that parameter, where
it is documented to be used to distinguish between server and client
socket (is there a difference??). Looking into the native code for that
thought, this method calls JVM_Socket() with that parameter to
distinguish between datagram and stream sockets. Something does not fit
here... Is this parameter used at all?
Cheers,
/Roman
That parameter is a left over of a very early version of the
Socket/SocketImpl API.
It is now obsolete mostly and was left for backward compatibility reasons.
In, short, no, it's not used anymore since all SocketImpls are now TCP
based.