package nanomsg;

import nanomsg.exceptions.IOException;

/**
 * Common interface that should implement all sockets.
 */
public interface ISocket {
  public void close() throws IOException;
  public int getNativeSocket();
  public void bind(final String dir) throws IOException;
  public void connect(final String dir) throws IOException;
  public void subscribe(final String data) throws IOException;
  public void subscribe(final byte[] data) throws IOException;

  public int sendString(final String data, final boolean blocking) throws IOException, IOException;
  public int sendString(final String data) throws IOException, IOException;
  public int sendBytes(final byte[] data, final boolean blocking) throws IOException, IOException;
  public int sendBytes(final byte[] data) throws IOException, IOException;

  public String recvString(final boolean blocking) throws IOException, IOException;
  public String recvString() throws IOException, IOException;

  public byte[] recvBytes(final boolean blocking) throws IOException, IOException;
  public byte[] recvBytes() throws IOException, IOException;

  public int getFd(final int flag) throws IOException;

  public void setSendTimeout(final int milis);
  public void setRecvTimeout(final int milis);
}

@@ -154,71 +154,72 @@
 lic 
-void close() throws IOException;%0A  public int getNativeSocket()
+int getNativeSocket();%0A%0A  public void close() throws IOException
 ;%0A  
@@ -325,32 +325,33 @@
 ws IOException;%0A
+%0A
   public void su
@@ -339,38 +339,32 @@
 ;%0A%0A  public 
-void subscribe
+int send
 (final Strin
@@ -361,32 +361,56 @@
 inal String data
+, final boolean blocking
 ) throws IOExcep
@@ -428,35 +428,29 @@
 lic 
-void subscribe
+int send
 (final 
-byte%5B%5D
+String
  dat
@@ -464,33 +464,32 @@
 ws IOException;%0A
-%0A
   public int sen
@@ -489,35 +489,29 @@
 int send
-String
 (final 
-String
+byte%5B%5D
  data, f
@@ -535,37 +535,24 @@
 king) throws
- IOException,
  IOException
@@ -574,27 +574,21 @@
 send
-String
 (final 
-String
+byte%5B%5D
  dat
@@ -592,37 +592,24 @@
 data) throws
- IOException,
  IOException
@@ -627,34 +627,31 @@
 int send
-Bytes
 (final 
-byte%5B%5D
+IMessage
  data, f
@@ -675,37 +675,24 @@
 king) throws
- IOException,
  IOException
@@ -714,26 +714,23 @@
 send
-Bytes
 (final 
-byte%5B%5D
+IMessage
  dat
@@ -734,37 +734,24 @@
 data) throws
- IOException,
  IOException
@@ -806,37 +806,24 @@
 king) throws
- IOException,
  IOException
@@ -855,37 +855,24 @@
 ing() throws
- IOException,
  IOException
@@ -934,33 +934,68 @@
 rows IOException
-,
+;%0A  public byte%5B%5D recvBytes() throws
  IOException;%0A  
@@ -984,32 +984,33 @@
 ws IOException;%0A
+%0A
   public byte%5B%5D 
@@ -1006,46 +1006,97 @@
 lic 
-byte%5B%5D recvBytes() throws IOException,
+IMessage recv(final boolean blocking) throws IOException;%0A  public IMessage recv() throws
  IOE
@@ -1099,32 +1099,35 @@
  IOException;%0A%0A 
+ //
  public int getF

Simplify ISocket interface.