/// <summary> /// Receive a packet asynchronously /// </summary> /// <param name="packet">SNI packet</param> /// <returns>SNI error code</returns> public uint ReceiveAsync(ref SNIPacket packet) { lock (this) { return(_lowerHandle.ReceiveAsync(ref packet)); } }
/// <summary> /// Receive a packet asynchronously /// </summary> /// <param name="packet">SNI packet</param> /// <returns>True if completed synchronous, otherwise false</returns> public void ReceiveAsync(ref SNIPacket packet) { lock (this) { SNIError sniError; bool completedSync = _lowerHandle.ReceiveAsync(true, ref packet, out sniError); Debug.Assert(!completedSync && (sniError == null), "Should not have completed sync"); } }
/// <summary> /// Receive a packet asynchronously /// </summary> /// <param name="packet">SNI packet</param> /// <returns>SNI error code</returns> public uint ReceiveAsync(ref SNIPacket packet) { if (packet != null) { packet.Release(); packet = null; } lock (this) { return(_lowerHandle.ReceiveAsync(ref packet)); } }
/// <summary> /// Read packet asynchronously /// </summary> /// <param name="handle">SNI handle</param> /// <param name="packet">Packet</param> /// <returns>SNI error status</returns> public uint ReadAsync(SNIHandle handle, ref SNIPacket packet) { packet = new SNIPacket(null); return(handle.ReceiveAsync(ref packet)); }
/// <summary> /// Read packet asynchronously /// </summary> /// <param name="handle">SNI handle</param> /// <param name="packet">Packet</param> /// <returns>SNI error status</returns> public uint ReadAsync(SNIHandle handle, ref SNIPacket packet) { packet = new SNIPacket(null); return handle.ReceiveAsync(ref packet); }
/// <summary> /// Read packet asynchronously /// </summary> /// <param name="handle">SNI handle</param> /// <param name="packet">Packet</param> /// <returns>SNI error status</returns> public uint ReadAsync(SNIHandle handle, out SNIPacket packet) { packet = null; return(handle.ReceiveAsync(ref packet)); }
/// <summary> /// Read packet asynchronously /// </summary> /// <param name="handle">SNI handle</param> /// <param name="packet">Packet</param> /// <returns>SNI error status</returns> public uint ReadAsync(SNIHandle handle, out SNIPacket packet, bool isMars = false) { packet = new SNIPacket(null); return(handle.ReceiveAsync(ref packet)); }