Пример #1
0
        public static SocketTestClient SocketTestClientFactory(
            ITestOutputHelper log,
            SocketImplementationType type,
            string server,
            int port,
            int iterations,
            string message,
            Stopwatch timeProgramStart)
        {
            switch (type)
            {
            case SocketImplementationType.APM:
                var socketAPM = new SocketTestClientAPM(log, server, port, iterations, message, timeProgramStart);
                log.WriteLine(socketAPM.GetHashCode() + " SocketTestClientAPM(..)");
                return(socketAPM);

            case SocketImplementationType.Async:
                var socketAsync = new SocketTestClientAsync(log, server, port, iterations, message, timeProgramStart);
                log.WriteLine(socketAsync.GetHashCode() + " SocketTestClientAsync(..)");
                return(socketAsync);

            default:
                throw new ArgumentOutOfRangeException("type");
            }
        }
Пример #2
0
        public static SocketTestClient SocketTestClientFactory(
            ITestOutputHelper log,
            SocketImplementationType type,
            string server,
            int port,
            int iterations,
            string message,
            Stopwatch timeProgramStart)
        {
            switch (type)
            {
                case SocketImplementationType.APM:
                    var socketAPM = new SocketTestClientAPM(log, server, port, iterations, message, timeProgramStart);
                    log.WriteLine(socketAPM.GetHashCode() + " SocketTestClientAPM(..)");
                    return socketAPM;
                case SocketImplementationType.Async:
                    var socketAsync = new SocketTestClientAsync(log, server, port, iterations, message, timeProgramStart);
                    log.WriteLine(socketAsync.GetHashCode() + " SocketTestClientAsync(..)");
                    return socketAsync;

                default:
                    throw new ArgumentOutOfRangeException(nameof(type));
            }
        }