public CreateDeepCopy ( ) : |
||
Результат |
private ArraySegment <byte> Detach(ref ServerAsyncEventArgs e, int size) { ServerAsyncEventArgs serverAsyncEventArgs = null; if (e.BytesTransferred > size) { serverAsyncEventArgs = e.CreateDeepCopy(); } ArraySegment <byte> result = e.DetachBuffer(); EventArgsManager.Put(ref e); if (serverAsyncEventArgs != null) { e = serverAsyncEventArgs; } return(result); }
private ArraySegment <byte> Detach(ref ServerAsyncEventArgs e, int size) { ServerAsyncEventArgs copy = null; if (e.BytesTransferred > size) { copy = e.CreateDeepCopy(); } var result = e.DetachBuffer(); EventArgsManager.Put(ref e); if (copy != null) { e = copy; } return(result); }
public int ProccessTransactionUser(int statusCode, ServerAsyncEventArgs e) { int action = 0; switch (State) { case Transaction.States.Trying: action |= Transaction.Action.SendOutgoingMessage; if (statusCode >= 100 && statusCode <= 199) { eventArgs = e.CreateDeepCopy(); SetState(Transaction.States.Proceeding, ref action); } else if (statusCode >= 200 && statusCode <= 699) { if (e.LocalEndPoint.IsTransportUnreliable()) SetState(Transaction.States.Completed, ref action); else SetState(Transaction.States.Terminated, ref action); } break; case Transaction.States.Proceeding: action |= Transaction.Action.SendOutgoingMessage; if (statusCode >= 200 && statusCode <= 699) { if (e.LocalEndPoint.IsTransportUnreliable()) { eventArgs = e.CreateDeepCopy(); SetState(Transaction.States.Completed, ref action); } else { SetState(Transaction.States.Terminated, ref action); } } break; case Transaction.States.Completed: case Transaction.States.Terminated: break; } return action; }
private ArraySegment<byte> Detach(ref ServerAsyncEventArgs e, int size) { ServerAsyncEventArgs copy = null; if (e.BytesTransferred > size) copy = e.CreateDeepCopy(); var result = e.DetachBuffer(); EventArgsManager.Put(ref e); if (copy != null) e = copy; return result; }
public int ProccessTransactionUser(bool isAck, ServerAsyncEventArgs e) { int action = 0; switch (State) { case Transaction.States.Created: action |= Transaction.Action.SendOutgoingMessage; eventArgs = e.CreateDeepCopy(); action |= SetState(Transaction.States.Calling); break; case Transaction.States.Calling: case Transaction.States.Proceeding: break; case Transaction.States.Completed: if (isAck && IsTransportUnreliable) { if (eventArgs != null) eventArgs.Dispose(); eventArgs = e.CreateDeepCopy(); isAckCached = true; } break; case Transaction.States.Terminated: break; } return action; }
private void CacheMessage(ServerAsyncEventArgs e) { if (eventArgs != null) eventArgs.Dispose(); eventArgs = e.CreateDeepCopy(); }
public int ProccessTransactionUser(bool isAck, ServerAsyncEventArgs e) { int action = 0; switch (State) { case Transaction.States.Created: action |= Transaction.Action.SendOutgoingMessage; if (e.LocalEndPoint.IsTransportUnreliable()) eventArgs = e.CreateDeepCopy(); action |= SetState(Transaction.States.Trying); break; case Transaction.States.Trying: case Transaction.States.Proceeding: case Transaction.States.Completed: case Transaction.States.Terminated: break; } return action; }