if (impl == null) throw new SocketException ("Cannot initialize Socket implementation");
if (isClosed()) throw new SocketException("socket is closed");
  public void setReceiveBufferSize(int size) throws SocketException  {    if (impl == null)      throw new SocketException ("Cannot initialize Socket implementation");    if (size < 0)      throw new IllegalArgumentException("Buffer size is less than 0");    impl.setOption(SocketOptions.SO_RCVBUF, new Integer(size));  }