Neptulon client implementation for Java. Also works on Android. Following are required:
- Java 1.7+ for Java apps.
- Android 4.1+ for Android apps.
Depends on following libraries:
- OkHttp for WebSockets
- GSON for JSON serialization.
Conn conn = new ConnImpl("ws://127.0.0.1:3000");
conn.middleware(new Logger());
conn.connect(new ConnCallback() { ... });
conn.sendRequest("hello", new HelloMessage("Hello from Java client!"), new ResCallback() {
@Override
public void handleResponse(ResCtx ctx) {
System.out.println("Received 'hello' response: " + ctx.getResult(Object.class));
}
});
./gradlew build
Start a Neptulon server at local address: 127.0.0.1:3001
and then:
./gradlew check