public TcpTransport(TcpTransportConfiguration configuration, IGelfMessageSerializer messageSerializer, Func <ITcpConnection> createConnection) { this.configuration = configuration; this.messageSerializer = messageSerializer; this.createConnection = createConnection; }
protected override ITransport InitializeTransport(IEasyGelfLogger logger) { var configuration = new TcpTransportConfiguration { RemoteAddress = RemoteAddress, RemotePort = RemotePort, }; return new TcpTransport(configuration, new GelfMessageSerializer()); }
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()); }
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))); } }
public TcpTransport(TcpTransportConfiguration configuration, IGelfMessageSerializer messageSerializer) { this.configuration = configuration; this.messageSerializer = messageSerializer; }
public TcpConnection(TcpTransportConfiguration configuration) { this.configuration = configuration; client = new TcpClient(); }
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))); }