예제 #1
0
        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);
            }
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
        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.");
        }