示例#1
0
        void Connection_MessageSending(object sender, MessageEventArgs e)
        {
            try
            {
                if (_settings.Logger != null)
                {
                    string name = (Service is BitTunnelClientService && (Service as BitTunnelClientService).ConnectionDetails != null)
                        ? (Service as BitTunnelClientService).ConnectionDetails.PublicName
                        : "Server";

                    _settings.Logger.ViewMessage(name, MessageAction.Sending, e.Message as BaseMessage, e.TimeStamp);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        void Connection_MessageReceived(object sender, MessageEventArgs e)
        {
            if (_settings.Logger != null)
            {
                string name = Service is BitTunnelClientService ? (Service as BitTunnelClientService).ConnectionDetails.PublicName : "Server";
                _settings.Logger.ViewMessage(name, MessageAction.Receiving, e.Message as BaseMessage, e.TimeStamp);
            }

            if (MessageReceived != null)
            {
                MessageReceived(sender, e);
            }

            OnMessageReceived(e.Message);
        }
 void client_MessageReceived(object sender, MessageEventArgs e)
 {
     _clientMessage = e.Message;
 }
 void _factory_MessageSending(object sender, MessageEventArgs e)
 {
     OnMessageSending(e.Message);
     if (MessageSending != null)
     {
         MessageSending(sender, e);
     }
 }
 void _factory_MessageReceived(object sender, MessageEventArgs e)
 {
     OnMessageReceived(e.Message);
     if (MessageReceived != null)
     {
         MessageReceived(sender, e);
     }
 }
 void protocol_MessageSending(object sender, MessageEventArgs e)
 {
     if (MessageSending != null)
     {
         MessageSending(sender, e);
     }
 }