Esempio n. 1
0
 public override void Start()
 {
     TcpClient client = new TcpClient();
     client.Connect(iporhost, port);
     connection = new DeveConnection(client, this);
     connection.Start();
 }
Esempio n. 2
0
 /// <summary>
 /// Only for internal use
 /// </summary>
 /// <param name="client"></param>
 internal void RemoveClient(DeveConnection client)
 {
     lock (clientConnections)
     {
         clientConnections.Remove(client);
     }
 }
Esempio n. 3
0
        public ScreenClientje(Rectangle rect, Game1 game, DeveConnection deveConnection)
            : base(deveConnection)
        {
            this.rect = rect;
            this.game = game;
            rectSprite = new RectangleSprite(rect, 5, game);

            SendNewPos();
        }
Esempio n. 4
0
 public void RemoveFromAllClientLists(DeveConnection deveConnection)
 {
     if (allClientjes.ContainsKey(deveConnection))
     {
         allClientjes.Remove(deveConnection);
     }
     if (controlClientjes.ContainsKey(deveConnection))
     {
         controlClientjes.Remove(deveConnection);
     }
     if (screenClientjes.ContainsKey(deveConnection))
     {
         screenClientjes.Remove(deveConnection);
     }
 }
 public DeveIncomingMessage(DeveConnection sender, byte[] bytes)
 {
     this.bytes = bytes;
     this.sender = sender;
     messageType = (DeveMessageType)ReadByte();
 }
Esempio n. 6
0
 public Clientje(DeveConnection deveConnection)
 {
     this.deveConnection = deveConnection;
     guid = Guid.NewGuid().ToString();
 }
 public ControlClientje(DeveConnection deveConnection)
     : base(deveConnection)
 {
 }
 public ControlClientje(DeveConnection deveConnection, Game1 game)
     : base(deveConnection)
 {
     this.game = game;
 }
Esempio n. 9
0
        private void Runner()
        {
            tcpListener.Start();

                while (!shouldShutdown)
                {
                    if (!tcpListener.Pending())
                    {
                        Thread.Sleep(100);
                    }
                    else
                    {
                        //blocks until a client has connected to the server
                        TcpClient client = tcpListener.AcceptTcpClient();
                        Console.WriteLine("Client connected");

                        DeveConnection deveClientConnection = new DeveConnection(client, this);
                        deveClientConnection.Start();

                        lock (clientConnections)
                        {
                            clientConnections.Add(deveClientConnection);
                        }

                        //Thread clientThread = new Thread(new ParameterizedThreadStart(HandleClientComm));
                        //clientThread.Start(client);
                    }
                }

                foreach (DeveConnection deveClientConnection in clientConnections)
                {
                    deveClientConnection.Stop();
                }

                tcpListener.Stop();
        }
Esempio n. 10
0
 public ScreenClientje(DeveConnection deveConnection, int numberOfScreen)
     : base(deveConnection)
 {
     this.numberOfScreen = numberOfScreen;
 }
Esempio n. 11
0
 public Clientje(DeveConnection deveConnection)
 {
     this.deveConnection = deveConnection;
 }