David Daney wrote: > Jeroen Frijters wrote: > > Hi, > > > > I think we need the patch below to fix the following case: > > > > Socket sock = new Socket(); > > sock.setKeepAlive(false); > > > > Currently this throws a NullPointerException (on IKVM at least), > because the impl.create() hasn't been called yet. > > > > Any comments? > > > > > Could you just call impl.create() from the Socket constructor?
I considered that, but it causes an unnecessary native socket to be created in the case of a ServerSocket which creates a Socket to use as the accept socket. I suppose we could fix that by adding a package private constructor to Socket for use by ServerSocket. Regards, Jeroen