private void ListenerThreadProc() { while (true) { TransportClient client = AcceptClient(); listener.OnAcceptClient(client); } }
public TransportClient AcceptClient() { TcpClient tcpClient; TransportClient client; tcpClient = tcpListener.AcceptTcpClient(); tcpClient.NoDelay = true; client = new TransportClient(tcpClient); return(client); }
public TransportClient AcceptClient() { TcpClient tcpClient; TransportClient client; tcpClient = tcpListener.AcceptTcpClient(); tcpClient.NoDelay = true; client = new TransportClient(tcpClient); return client; }
static void ThreadProc(TransportClient client) { try { while (client.isConnected()) { client.RecvPDU(); Thread.Sleep(10); } } catch (Exception e) { Console.WriteLine(e.ToString()); } }
/** * 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(); }
/** * 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(); }
/** * 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."); } }
static void ThreadProc(TransportClient client) { try { while (client.isConnected()) { client.RecvPDU(); Thread.Sleep(10); } } catch(Exception e) { Console.WriteLine(e.ToString()); } }
public SurfaceServer(TransportClient transport, ISurfaceServer listener) { this.transport = transport; this.listener = listener; }
public MainWindow(int m) : base(Gtk.WindowType.Toplevel) { Build(); /* Instantiate client states */ clientStates = new IClientState[4] { new StartedState(this), new SenderCreatedState(this), new ReceiverJoinedState(this), new ReceiverAuthenticatedState(this) }; /* Set current state to STARTED */ currentState = clientStates[STARTED_STATE]; mode = m; width = 1024; height = 768; config = Config.Load(); window = mainDrawingArea.GdkWindow; drawable = (Gdk.Drawable) window; gc = new Gdk.GC(drawable); gc.ClipRectangle = new Gdk.Rectangle(0, 0, width, height); surface = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, width, height); window.InvalidateRect(new Gdk.Rectangle(0, 0, width, height), true); receiver = new SurfaceReceiver(window, surface); OutOfSessionWindow(); this.transport = null; rdpSource = new RdpSource(this); pcapSource = new PcapSource(this); if (config.BroadcasterAutoconnect) OnUserConnect(config.BroadcasterHostname, config.BroadcasterPort); }
public SessionServer(TransportClient transport, ISessionRequestListener listener) { this.transport = transport; this.listener = listener; }
public InputClient(TransportClient transport) { this.transport = transport; this.listener = null; this.active = false; }
public SessionClient(TransportClient transport, ISessionResponseListener listener) { this.transport = transport; this.listener = listener; this.sessionId = 0; }
static void ThreadProc(TransportClient client) { while (true) { client.RecvPDU(); Thread.Sleep(10); } }
public SurfaceClient(ISurfaceClient client, TransportClient transport) { this.client = client; this.transport = transport; }
public MainWindow(int m) : base(Gtk.WindowType.Toplevel) { Build(); /* Instantiate client states */ clientStates = new IClientState[7] { new StartedState(this), new SenderCreatedState(this), new ReceiverJoinedState(this), new ReceiverAuthenticatedState(this), new SenderSendingState(this), new ReceiverInControlState(this), new SenderSendingRemoteState(this) }; /* Set current state to STARTED */ currentState = clientStates[STARTED_STATE]; currentState.refresh(); width = 1024; height = 768; config = Config.Load(); window = mainDrawingArea.GdkWindow; drawable = (Gdk.Drawable) window; mainDrawingArea.AddEvents( (int) Gdk.EventMask.ButtonPressMask | (int) Gdk.EventMask.ButtonReleaseMask | (int) Gdk.EventMask.PointerMotionMask | (int) Gdk.EventMask.KeyPressMask | (int) Gdk.EventMask.KeyReleaseMask); gc = new Gdk.GC(drawable); gc.ClipRectangle = new Gdk.Rectangle(0, 0, width, height); surface = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, width, height); window.InvalidateRect(new Gdk.Rectangle(0, 0, width, height), true); receiver = new SurfaceReceiver(window, surface); this.transport = null; pcapSource = new PcapSource(this); keyboard = new Keyboard(); if (config.BroadcasterAutoconnect) OnUserConnect(config.BroadcasterHostname, config.BroadcasterPort); }
public void OnAcceptClient(TransportClient transportClient) { Console.WriteLine("Broadcaster.OnAcceptClient"); Client client = new Client(transportClient, SessionManager.Instance); clients.TryAdd(transportClient, client); }
public SurfaceServer(TransportClient transport) { this.transport = transport; }
public void OnAcceptClient(TransportClient transportClient) { Console.WriteLine("OnAcceptClient"); new Client(transportClient, ScreenSessions.Instance); }
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); }