public object HeaderReceived(object inetdealclient)
        {
            string serverEcho = Transfer.HeaderReceived.Context.Echo;
            WriteEcho(string.Format("Server header received"));
            if (serverEcho != null && serverEcho != "")
                WriteEcho(string.Format("Server echo: {0}", serverEcho));

            IDealClient idc = (IDealClient)inetdealclient;

            if (idc.Context.Close)
                idc.Dispose();
            else
            {
                if (!idc.Context.Synchronic)
                {
                    if (idc.Context.SendMessage)
                        idc.Send(MessagePart.Message);
                }
                if (idc.Context.ReceiveMessage)
                    idc.Receive(MessagePart.Message);
            }

            if (!idc.Context.ReceiveMessage &&
                !idc.Context.SendMessage)
            {
                if(CompleteEvent != null)
                    CompleteEvent.Execute(idc.Context);
                if (!isAsync)
                    completeNotice.Set();
            }
            return idc.Context;            
        }
        public object HeaderSent(object inetdealclient)
        {
            WriteEcho("Client header sent");
            IDealClient idc = (IDealClient)inetdealclient;
            if (!idc.Context.Synchronic)
                idc.Receive(MessagePart.Header);
            else
                idc.Send(MessagePart.Message);

           return idc.Context;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Сервис веб приложения
 /// </summary>
 public WebAppTestService(
     IDealClient dealClient,
     IConfiguration configuration,
     ICurrencyClient currencyClient,
     ITransactionClient transactionClient
     )
 {
     _dealClient        = dealClient;
     _configuration     = configuration;
     _currencyClient    = currencyClient;
     _transactionClient = transactionClient;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// The Connected.
        /// </summary>
        /// <param name="inetdealclient">The inetdealclient<see cref="object"/>.</param>
        /// <returns>The <see cref="object"/>.</returns>
        public object Connected(object inetdealclient)
        {
            WriteEcho("Client Connection Established");
            Transfer.MyHeader.Context.Echo = "Client say Hello. ";
            Context = Client.Context;
            Client.Context.Transfer = Transfer;

            IDealClient idc = (IDealClient)inetdealclient;

            idc.Send(MessagePart.Header);

            return(idc.Context);
        }
        public object MessageSent(object inetdealclient)
        {
            WriteEcho("Client message sent");

            IDealClient idc = (IDealClient)inetdealclient;
            if (idc.Context.Synchronic)
                idc.Receive(MessagePart.Header);
       
            if (!idc.Context.ReceiveMessage)
            {
                if (CompleteEvent != null)
                    CompleteEvent.Execute(idc.Context);
                if (!isAsync)
                    completeNotice.Set();
            }
            return idc.Context;
        }