ENet JNI API update

This commit is contained in:
Cameron Gutman 2016-03-07 14:35:52 -08:00
parent a8c460e715
commit ef8c49f135

View File

@ -21,7 +21,7 @@ public class EnetConnection implements Closeable {
public static EnetConnection connect(String host, int port, int timeout) throws IOException { public static EnetConnection connect(String host, int port, int timeout) throws IOException {
EnetConnection conn = new EnetConnection(); EnetConnection conn = new EnetConnection();
conn.enetClient = createClient(); conn.enetClient = createClient(host);
if (conn.enetClient == 0) { if (conn.enetClient == 0) {
throw new IOException("Unable to create ENet client"); throw new IOException("Unable to create ENet client");
} }
@ -103,7 +103,7 @@ public class EnetConnection implements Closeable {
} }
private static native int initializeEnet(); private static native int initializeEnet();
private static native long createClient(); private static native long createClient(String address);
private static native long connectToPeer(long client, String host, int port, int timeout); private static native long connectToPeer(long client, String host, int port, int timeout);
private static native int readPacket(long client, byte[] data, int length, int timeout); private static native int readPacket(long client, byte[] data, int length, int timeout);
private static native boolean writePacket(long client, long peer, byte[] data, int length, int packetFlags); private static native boolean writePacket(long client, long peer, byte[] data, int length, int packetFlags);