use of com.benmu.framework.extend.adapter.LightlyWebSocketAdapter in project WeexErosFramework by bmfe.
the class WebSocketModule method send.
@JSMethod
public void send(String data) {
Log.e(TAG, "send>>>>>>" + data + this);
if (!reportErrorIfNoAdapter()) {
LightlyWebSocketAdapter bmWebSocketAdapter = (LightlyWebSocketAdapter) webSocketAdapter;
bmWebSocketAdapter.send(data, mWXSDKInstance.getInstanceId());
}
}
use of com.benmu.framework.extend.adapter.LightlyWebSocketAdapter in project WeexErosFramework by bmfe.
the class WebSocketModule method close.
@JSMethod
public void close(String code, String reason) {
if (!reportErrorIfNoAdapter()) {
Log.e(TAG, "close>>>>>>" + reason);
int codeNumber = WebSocketCloseCodes.CLOSE_NORMAL.getCode();
if (code != null) {
try {
codeNumber = Integer.parseInt(code);
} catch (NumberFormatException e) {
// ignore
}
}
LightlyWebSocketAdapter bmWebSocketAdapter = (LightlyWebSocketAdapter) webSocketAdapter;
bmWebSocketAdapter.close(codeNumber, reason, mWXSDKInstance.getInstanceId());
}
}
use of com.benmu.framework.extend.adapter.LightlyWebSocketAdapter in project WeexErosFramework by bmfe.
the class WebSocketModule method webSocket.
@JSMethod
public void webSocket(String url, String protocol) {
webSocketAdapter = mWXSDKInstance.getWXWebSocketAdapter();
Log.e("webSocket", "this>>>>>" + this + "id>>>>>" + mWXSDKInstance.getInstanceId());
if (!reportErrorIfNoAdapter()) {
LightlyWebSocketAdapter bmWebSocketAdapter = (LightlyWebSocketAdapter) webSocketAdapter;
bmWebSocketAdapter.connect(url, protocol, eventListener, mWXSDKInstance.getInstanceId());
}
}
Aggregations