示例#1
0
 public TcpTransport(TcpTransportConfiguration configuration,
                     IGelfMessageSerializer messageSerializer,
                     Func <ITcpConnection> createConnection)
 {
     this.configuration     = configuration;
     this.messageSerializer = messageSerializer;
     this.createConnection  = createConnection;
 }
示例#2
0
		protected override ITransport InitializeTransport(IEasyGelfLogger logger)
		{
			var configuration = new TcpTransportConfiguration
			{
				RemoteAddress = RemoteAddress,
				RemotePort = RemotePort,
			};
			return new TcpTransport(configuration, new GelfMessageSerializer());
		}
示例#3
0
 protected override ITransport InitializeTransport(IEasyGelfLogger logger)
 {
     var remoteIpAddress = Dns.GetHostAddresses(RemoteAddress)
         .Shuffle()
         .FirstOrDefault() ?? IPAddress.Loopback;
     var configuration = new TcpTransportConfiguration
         {
             Host = new IPEndPoint(remoteIpAddress, RemotePort),
         };
     return new TcpTransport(configuration, new GelfMessageSerializer());
 }
示例#4
0
 public static ITransport Produce(TcpTransportConfiguration configuration)
 {
     if (configuration.Ssl)
     {
         return(new TcpTransport(configuration, new GelfMessageSerializer(), () => new TcpSslConnection(configuration)));
     }
     else
     {
         return(new TcpTransport(configuration, new GelfMessageSerializer(), () => new TcpConnection(configuration)));
     }
 }
示例#5
0
 public TcpTransport(TcpTransportConfiguration configuration, IGelfMessageSerializer messageSerializer)
 {
     this.configuration = configuration;
     this.messageSerializer = messageSerializer;
 }
示例#6
0
        public TcpConnection(TcpTransportConfiguration configuration)
        {
            this.configuration = configuration;

            client = new TcpClient();
        }
示例#7
0
 public TcpTransport(TcpTransportConfiguration configuration, IGelfMessageSerializer messageSerializer)
 {
     this.configuration     = configuration;
     this.messageSerializer = messageSerializer;
 }
示例#8
0
 public static ITransport Produce(TcpTransportConfiguration configuration, IEasyGelfLogger logger)
 {
     return(configuration.Ssl
         ? new TcpTransport(configuration, new GelfMessageSerializer(logger), () => new TcpSslConnection(configuration))
         : new TcpTransport(configuration, new GelfMessageSerializer(logger), () => new TcpConnection(configuration)));
 }