Beispiel #1
0
        /// <summary>
        /// Creates a connection to the specified address.
        /// </summary>
        /// <param name="connectionDetails">Provides all the connection details.</param>
        /// <returns>A Task&lt;IHostConnection&gt;.</returns>
        public static async Task <IHostConnection> Create(ClientConnectionDetails connectionDetails)
        {
            var instance = new MllpClient(connectionDetails);
            await instance.Setup();

            return(instance);
        }
        /// <summary>
        /// Creates a new instance of the <see cref="MllpClient"/> class.
        /// </summary>
        /// <param name="address"></param>
        /// <param name="port"></param>
        /// <param name="messageLog"></param>
        /// <param name="parser"></param>
        /// <param name="encoding"></param>
        /// <param name="clientCertificates"></param>
        /// <param name="userCertificateValidationCallback"></param>
        /// <returns></returns>
        public static async Task <IHostConnection> Create(
            string address,
            int port,
            IMessageLog?messageLog = null,
            PipeParser?parser      = null,
            Encoding?encoding      = null,
            X509CertificateCollection?clientCertificates = null,
            RemoteCertificateValidationCallback?
            userCertificateValidationCallback = null)
        {
            var instance = new MllpClient(
                address,
                port,
                messageLog ?? NullLog.Get(),
                parser ?? new PipeParser(),
                encoding ?? Encoding.ASCII,
                clientCertificates,
                userCertificateValidationCallback);
            await instance.Setup().ConfigureAwait(false);

            return(instance);
        }
Beispiel #3
0
 /// <summary>
 /// Gets an instance of an MLLP connection.
 /// </summary>
 /// <param name="connectionDetails">
 /// The connection Details.
 /// </param>
 /// <returns>
 /// An MLLP connection as an async operation.
 /// </returns>
 public Task <IHostConnection> GetClientConnection(ClientConnectionDetails connectionDetails)
 {
     return(MllpClient.Create(connectionDetails));
 }