public static void SendReleaseResponse(Association asc) { var resp = new ReleaseResponse(); asc.Logger.Log("-->" + resp); byte[] message = resp.Write(); if (asc.Stream.CanWrite) { asc.Stream.Write(message, 0, message.Length); } }
public static void SendReleaseResponse(Association asc) { var resp = new ReleaseResponse(); asc.Logger.Log("-->" + resp); var message = resp.Write(); if (asc.Stream.CanWrite) { asc.Stream.Write(message, 0, message.Length); asc.State = NetworkState.CLOSING_ASSOCIATION; } }
public static Message <ReleaseResponse> ReadReleaseResponse(NetworkBinaryReader dr) { var relRes = new ReleaseResponse(); if (relRes.Write().Skip(1).SequenceEqual(dr.Take(9))) { return(new Message <ReleaseResponse> { Payload = relRes, Type = MessageType.PDU }); } //Invalid release response throw new Exception("Release response was invalid. Did not match signature."); }