/// <summary> /// Creates a new asynchronous socket. /// </summary> /// <param name="socket">The associated socket.</param> public AsyncSocket(Socket socket) { Socket = socket; Socket.Blocking = false; ReadResult = new AsyncSocketReadResult(this); }
/// <summary> /// Handles a complete read. /// </summary> /// <param name="readResult">The socket's read result.</param> /// <returns>The state of the read result.</returns> /// <remarks>The buffer of the read result may contain bytes from the next packet. Thus make sure you handle packet-splitting.</remarks> public abstract AsyncSocketReadContextState HandleRead(AsyncSocketReadResult readResult);
/// <summary> /// Gets the state of the read result. /// </summary> /// <param name="readResult">The socket's read result.</param> /// <returns>The state of the read result.</returns> protected abstract AsyncSocketReadContextState GetState(AsyncSocketReadResult readResult);