From c682a7caac6475185c9cc6af782180414b71e2ad Mon Sep 17 00:00:00 2001 From: ehouse Date: Tue, 26 Jan 2010 14:46:48 +0000 Subject: [PATCH] snapshot work toward getting networking done. --- .../eehouse/android/xw4/jni/CommsAddrRec.java | 5 ++++ .../android/xw4/jni/TransportProcs.java | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java new file mode 100644 index 000000000..5c5507aa8 --- /dev/null +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java @@ -0,0 +1,5 @@ + +package org.eehouse.android.xw4.jni; + +public class CommsAddrRec { +} diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/TransportProcs.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/TransportProcs.java index 5ad1b410a..f51c95357 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/TransportProcs.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/TransportProcs.java @@ -2,4 +2,31 @@ package org.eehouse.android.xw4.jni; public interface TransportProcs { + int transportSend( byte[] buf, int len, final CommsAddrRec addr ); + + public static final int COMMS_RELAYSTATE_UNCONNECTED = 0; + public static final int COMMS_RELAYSTATE_DENIED = 1; + public static final int COMMS_RELAYSTATE_CONNECT_PENDING = 2; + public static final int COMMS_RELAYSTATE_CONNECTED = 3; + public static final int COMMS_RELAYSTATE_RECONNECTED = 4; + public static final int COMMS_RELAYSTATE_ALLCONNECTED = 5; + void relayStatus( int newState ); + + void relayConnd( boolean allHere, int nMissing ); + + public static enum XWRELAY_ERROR { NONE + ,OLDFLAGS + ,BADPROTO + ,RELAYBUSY + ,SHUTDOWN + ,TIMEOUT + ,HEART_YOU + ,HEART_OTHER + ,LOST_OTHER + ,OTHER_DISCON + ,NO_ROOM + ,DUP_ROOM + ,TOO_MANY + }; + void relayErrorProc( XWRELAY_ERROR relayErr ); }