public void disconnect() { // Block double disconnection if (State.equals(STATE.DISCONNECTED)) { return; } // Wipe state State = STATE.DISCONNECTED; SessionId = null; disconnect1(); }
private void eventDelegateLoaded(String sessionId) { if (!State.equals(STATE.CONNECTING)) { exception("BadServerMessageException", "Multiple loaded events have occured."); return; } // Note that we're connected State = STATE.CONNECTED; SessionId = sessionId; // Call connected event Handler.onStartupSuccess(); pushlishQueueLength(); flushBuffer(); }
/* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final GameCallReturnSummary other = (GameCallReturnSummary) obj; if (mDuplicatorResponses == null) { if (other.mDuplicatorResponses != null) return false; } else if (!mDuplicatorResponses.equals(other.mDuplicatorResponses)) return false; if (mSpoilerDestinationState == null) { if (other.mSpoilerDestinationState != null) return false; } else if (!mSpoilerDestinationState.equals(other.mSpoilerDestinationState)) return false; if (mSummarySource == null) { if (other.mSummarySource != null) return false; } else if (!mSummarySource.equals(other.mSummarySource)) return false; return true; }
public void call(Call call) { // Calculate callId if (NextCallSeqId > 9223372036854775806L) { NextCallSeqId = 1; } int callSeqId = NextCallSeqId++; // Add receiver to pending OutstandingCalls.put(new Integer(callSeqId), call); pushlishQueueLength(); // Add the call to out-bound queue queueTx(callSeqId, call.getTx()); if (State.equals(STATE.CONNECTED)) { flushBuffer(); } }