Example #1
0
        public TransmitRes Transmit(IDSI dsiReq)
        {
            ServerDS sv;

            try {
                sv = NewServerDS(dsiReq);
            }
            catch (ExitShotException err) {
                throw new TransmitFailureException(err);
            }

            try {
                try {
                    lock (Sock) {
                        Sock.Send(dsiReq.ToArray(sv.RId));
                    }
                }
                catch (SocketException err) {
                    throw new TransmitFailureException(err);
                }

                sv.evRecv.WaitOne();

                if (sv.err != null)
                {
                    throw new TransmitFailureException(sv.err);
                }

                return(new TransmitRes(sv.dsiRes));
            }
            finally {
                DisconnectServerDS(sv);
            }
        }
Example #2
0
        public void Send(IDSI dsiReq)
        {
            ServerDS sv;

            try {
                sv = NewServerDS(dsiReq);
            }
            catch (ExitShotException err) {
                throw new TransmitFailureException(err);
            }

            try {
                try {
                    lock (Sock) {
                        Sock.Send(dsiReq.ToArray(sv.RId));
                    }
                }
                catch (SocketException err) {
                    throw new TransmitFailureException(err);
                }

                return;
            }
            finally {
                DisconnectServerDS(sv);
            }
        }
Example #3
0
        public TransmitRes Transmit(IDSI dsiReq) {
            ServerDS sv;
            try {
                sv = NewServerDS(dsiReq);
            }
            catch (ExitShotException err) {
                throw new TransmitFailureException(err);
            }

            try {
                try {
                    lock (Sock) {
                        Sock.Send(dsiReq.ToArray(sv.RId));
                    }
                }
                catch (SocketException err) {
                    throw new TransmitFailureException(err);
                }

                sv.evRecv.WaitOne();

                if (sv.err != null) throw new TransmitFailureException(sv.err);

                return new TransmitRes(sv.dsiRes);
            }
            finally {
                DisconnectServerDS(sv);
            }
        }
Example #4
0
        public void Send(IDSI dsiReq) {
            ServerDS sv;
            try {
                sv = NewServerDS(dsiReq);
            }
            catch (ExitShotException err) {
                throw new TransmitFailureException(err);
            }

            try {
                try {
                    lock (Sock) {
                        Sock.Send(dsiReq.ToArray(sv.RId));
                    }
                }
                catch (SocketException err) {
                    throw new TransmitFailureException(err);
                }

                return;
            }
            finally {
                DisconnectServerDS(sv);
            }
        }