if (impl == null) throw new SocketException ("Cannot initialize Socket implementation");
if (isClosed()) throw new SocketException("socket is closed");
  public int getReceiveBufferSize() throws SocketException  {    if (impl == null)      throw new SocketException ("Cannot initialize Socket implementation");    Object obj = impl.getOption(SocketOptions.SO_RCVBUF);      if (obj instanceof Integer)      return(((Integer)obj).intValue());    else       throw new SocketException("Unexpected type");  }