protected override async Task Close(WireConnection c, Endpoint e = null, CancellationToken cancel = default(CancellationToken)) { Task mutex = Close_mutex.Enter(); try { await mutex; MessageEntry m = new MessageEntry(MessageEntryType.WireDisconnectReq, MemberName); MessageEntry ret = await stub.ProcessRequest(m, cancel); connection = null; } finally { Close_mutex.Exit(mutex); } }
public async Task <uint> SendPacket(T packet, CancellationToken cancel = default(CancellationToken)) { Task mutex = send_mutex.Enter(); try { await mutex; send_packet_number = (send_packet_number < UInt32.MaxValue) ? send_packet_number + 1 : 0; await parent.SendPipePacket(packet, index, send_packet_number, RequestPacketAck, endpoint, cancel); return(send_packet_number); } finally { send_mutex.Exit(mutex); } }
public void Dispose() { owner.Exit(task); }