public ClientModel(int session, Socket clientSocket, clientSetupDelegate clientSetupDel, clientPlayDelegate clientPlayDel, clientPauseDelegate clientPauseDel, clientTearDownDelegate clientTearDownDel)
        {
            _clientSocket = clientSocket;

            _sessionNum = session;

            _clientSetupDel    = clientSetupDel;
            _clientPlayDel     = clientPlayDel;
            _clientPauseDel    = clientPauseDel;
            _clientTearDownDel = clientTearDownDel;
        }
예제 #2
0
        //Client RTSP connection thread for a client is created
        public void createClient(Socket clientSocket)
        {
            //Delgate methods for client model to call
            clientSetupDelegate    clientSetupDel    = new clientSetupDelegate(clientSetup);
            clientPlayDelegate     clientPlayDel     = new clientPlayDelegate(clientPlay);
            clientPauseDelegate    clientPauseDel    = new clientPauseDelegate(clientPause);
            clientTearDownDelegate clientTearDownDel = new clientTearDownDelegate(clientTearDown);

            //Creating the new client model thread for a connected client
            ClientModel client = new ClientModel(_session, clientSocket, clientSetupDel, clientPlayDel, clientPauseDel, clientTearDownDel);

            _session++;
            Thread clientThread = new Thread(new ThreadStart(() => client.listen()));

            clientThread.Start();
        }