Skip to content

pintawebware/WebSocket-Service-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSocket Autobahn Service on Android

This repo contains a module that allows to perform Call, Publish and Subscribe Wamp requests over a secured connection (wss protocol) with Autobahn WebSocket library. If websocket close connection there is periodic task (heartbeat) to make reconnection in indicated interval.

Usage

Make connection to websocket, response callback registration needed:

WsManager.getWsManager()
        .setPort(String port)
        .setLog(boolean isLogOn)
        .setHeartBeat(long heartBeatPeriodInMillis)
        .connect(Context context);

Make disconnect in websocket, response callback un-registration not needed:

WsManager.getWsManager().disconnect(Context context);

Register callback to receive responses from websocket:

WsManager.getWsManager().registerCallback(Context context, WsCallbackListeners wsCallbackListeners);

Unregister callback to receive responses from websocket:

WsManager.getWsManager().unregisterCallback(Context context);

Subscribe:

WsManager.getWsManager().subscribe(Context context, String topicName);

Call:

WsManager.getWsManager().call(Context context, String topicName);

Publish:

WsManager.getWsManager().publish(Context context, String topicName, String msg);

About

WebSocket Autobahn Service on Android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages