Ejemplo n.º 1
0
            /// <summary>
            /// Start network service.
            /// </summary>
            /// <param name="configure"></param>
            public static void Start(NetworkConfigure configure)
            {
                INetwork network = configure.NetworkCreate == null ? new NetworkServer() : configure.NetworkCreate();

                network.Start(configure);
                _pool.TryAdd(configure.NetworkID, network);
            }
Ejemplo n.º 2
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="configure"></param>
            /// <returns></returns>
            public static INetwork Connect(NetworkConfigure configure)
            {
                INetwork network = configure.NetworkCreate == null ? new NetworkClient() : configure.NetworkCreate();

                network.Start(configure);
                _pool.TryAdd(configure.NetworkID, network);
                return(network);
            }