*** empty log message ***
[IRC.git] / Robust / src / ClassLibrary / Java / Socket.java
index 297fe3d066532a2d964bdf23b37a5cc0c738f7d8..5863a518256c9c898522c12f789215e5705fbb00 100644 (file)
@@ -32,6 +32,18 @@ public class Socket {
     sout=new SocketOutputStream(this);
   }
 
+       public int connect(String host, int port) {
+    InetAddress address=InetAddress.getByName(host);
+               if (address != null) {
+                       fd=nativeBind(address.getAddress(), port);
+                       nativeConnect(fd, address.getAddress(), port);
+                       return 0;
+               }
+               else {
+                       return -1;
+               }
+       }
+
   public static native int nativeBind(byte[] address, int port);
 
   public static native int nativeConnect(int fd, byte[] address, int port);