예제 #1
0
        /**
         * Class constructor
         */
        public Client(TransportClient transport, IClientListener clientListener)
        {
            this.clientListener = clientListener;

            dispatcher = new ChannelDispatcher();

            transport.SetChannelDispatcher(dispatcher);

            surfaceServer = new SurfaceServer(transport, this);
            dispatcher.RegisterChannel(surfaceServer);

            sessionServer = new SessionServer(transport, this);
            dispatcher.RegisterChannel(sessionServer);

            inputServer = new InputServer(transport, this);
            dispatcher.RegisterChannel(inputServer);

            transport.StartThread();

            dispatcher.OnConnect();
        }
예제 #2
0
        /**
         * Class constructor
         */
        public Client(TransportClient transport, IClientRequestListener listener)
            : base(transport)
        {
            this.thread = new Thread(ReceiverThreadProc);
            thread.Start();

            this.listener = listener;
            this.transport = transport;
            dispatcher = new ChannelDispatcher();

            transport.SetChannelDispatcher(dispatcher);

            surface = new Surface(this.transport);
            dispatcher.RegisterChannel(surface);

            session = new Session(this.transport, this);
            dispatcher.RegisterChannel(session);

            dispatcher.OnConnect();

            transport.StartThread();
        }
예제 #3
0
    /**
     * Is invoked when application launches. Connects the Client to the Server
     */
    public void OnUserConnect(string address, int port)
    {
        ChannelDispatcher dispatcher = new ChannelDispatcher();
        this.transport = new TransportClient(dispatcher);

        sessionClient = new SessionClient(this.transport, this);
        dispatcher.RegisterChannel(sessionClient);

        surfaceClient = new SurfaceClient(this, this.transport);
        dispatcher.RegisterChannel(surfaceClient);

        inputClient = new InputClient(this.transport);
        dispatcher.RegisterChannel(inputClient);

        try
        {
            this.transport.Connect(address, port);
            DisplayStatusText("Welcome! You are connected to Screenary server at " + address + " : " + port);
        }
        catch (TransportException e)
        {
            ExceptionDialog exception = new ExceptionDialog("Operation Fail", "Could not connect to Screenary server at "
                + address + " : " + port + "\nVerify connections.");
        }
    }
예제 #4
0
 public TransportClient(ChannelDispatcher dispatcher, TcpClient tcpClient)
 {
     this.dispatcher = dispatcher;
     this.tcpClient = tcpClient;
 }
예제 #5
0
 public TransportClient(ChannelDispatcher dispatcher)
 {
     this.dispatcher = dispatcher;
     this.tcpClient = null;
 }
예제 #6
0
 public TransportClient(TcpClient tcpClient)
 {
     this.dispatcher = null;
     this.tcpClient = tcpClient;
 }
예제 #7
0
 public void SetChannelDispatcher(ChannelDispatcher dispatcher)
 {
     this.dispatcher = dispatcher;
 }
예제 #8
0
    public void OnUserConnect(string address, int port)
    {
        ChannelDispatcher dispatcher = new ChannelDispatcher();
        this.transport = new TransportClient(dispatcher);

        session = new Session(this.transport, this);
        dispatcher.RegisterChannel(session);

        SurfaceClient surface = new SurfaceClient(this, this.transport);
        dispatcher.RegisterChannel(surface);

        this.transport.Connect(address, port);

        Console.WriteLine("connected to screenary server at {0}:{1}", address, port);
        notificationBar.Push (id, "Welcome! You are connected to Screenary server at " + address + " : " + port);
    }
예제 #9
0
 public void SetChannelDispatcher(ChannelDispatcher dispatcher)
 {
     this.dispatcher = dispatcher;
 }
예제 #10
0
 public TransportClient(ChannelDispatcher dispatcher, TcpClient tcpClient)
 {
     this.dispatcher = dispatcher;
     this.tcpClient  = tcpClient;
 }
예제 #11
0
 public TransportClient(ChannelDispatcher dispatcher)
 {
     this.dispatcher = dispatcher;
     this.tcpClient  = null;
 }
예제 #12
0
 public TransportClient(TcpClient tcpClient)
 {
     this.dispatcher = null;
     this.tcpClient  = tcpClient;
 }