package com.frostwire.libtorrent;

public class Session {

    private final long session;

    private long upnp;
    private long natpmp;

    public Session() {
        this.session = create();
    }

    public void startNetworking() {
        upnp = startUPnP(session);
        natpmp = startNATPMP(session);

        startLSD(session);
        startDHT(session);
    }

    public void waitForAlerts(int millis) {
        waitForAlerts(session, millis);
    }

    @Override
    protected void finalize() throws Throwable {
        if (session != 0) {
            release(session);
        }
        super.finalize();
    }

    private native long create();

    private native void release(long handle);

    private native long startUPnP(long handle);

    private native long startNATPMP(long handle);

    private native void startLSD(long handle);

    private native void startDHT(long handle);

    private native void waitForAlerts(long handle, int millis);
}

@@ -721,28 +721,28 @@
 vate native 
-long
+void
  startUPnP(l
@@ -774,20 +774,20 @@
  native 
-long
+void
  startNA

update native signatures in java-land