Example #1
0
        public static CGameServiceProvider Create(String gameServerUrl)
        {
            var          callback         = new СGameServiceCallback();
            var          callbackInstance = new InstanceContext(callback);
            var          binding          = new NetTcpBinding(SecurityMode.None);
            var          chanel           = new DuplexChannelFactory <IGameService>(callback, binding);
            var          endPoint         = new EndpointAddress(gameServerUrl);
            IGameService proxy            = chanel.CreateChannel(endPoint);

            return(new CGameServiceProvider(proxy, callback));
        }
Example #2
0
 private CGameServiceProvider(IGameService gameService, СGameServiceCallback callback)
 {
     GameClient      = gameService;
     ServiceCallback = callback;
 }