public void endService(SessionType sessionType, byte sessionID) { synchronized (PROTOCOL_REFERENCE_LOCK) { if (_protocol != null) { _protocol.EndProtocolSession(sessionType, sessionID); } } }
// TODO void startHandShake() { synchronized (PROTOCOL_REFERENCE_LOCK) { if (_protocol != null) { _protocol.StartProtocolSession(SessionType.RPC); } } }
@Override public void onTransportBytesReceived(byte[] receivedBytes, int receivedBytesLength) { // Send bytes to protocol to be interpreted synchronized (PROTOCOL_REFERENCE_LOCK) { if (_protocol != null) { _protocol.HandleReceivedBytes(receivedBytes, receivedBytesLength); } } }
private void closeConnection(boolean willRecycle, byte rpcSessionID) { synchronized (PROTOCOL_REFERENCE_LOCK) { if (_protocol != null) { // If transport is still connected, sent EndProtocolSessionMessage if (_transport != null && _transport.getIsConnected()) { _protocol.EndProtocolSession(SessionType.RPC, rpcSessionID); } if (willRecycle) { _protocol = null; } } // end-if } synchronized (TRANSPORT_REFERENCE_LOCK) { if (willRecycle) { if (_transport != null) { _transport.disconnect(); } _transport = null; } } }
public void sendHeartbeat(SdlSession mySession) { if (_protocol != null && mySession != null) _protocol.SendHeartBeat(mySession.getSessionId()); }
public void sendMessage(ProtocolMessage msg) { if (_protocol != null) _protocol.SendMessage(msg); }