public RTPModel(IPAddress ipAddress, int port, printRTPHeader printRTPHeader)
        {
            _IPEndPoint = new IPEndPoint(ipAddress, port);

            _printRTPHeader = printRTPHeader;

            //Create socket for client connection
            s = new Socket(_IPEndPoint.Address.AddressFamily,
                           SocketType.Dgram,
                           ProtocolType.Udp);
        }
示例#2
0
        //Client setup
        public void clientSetup(Socket clientSocket, int port, int session, string videoWanted, string rtspPacket)
        {
            //Delegate methods for RTP model to call
            printRTPHeader printRTPHeader = new printRTPHeader(printHeader);

            //Create thread to start streaming video to client
            RTPModel rtpConnection = new RTPModel(((IPEndPoint)clientSocket.RemoteEndPoint).Address, port, printRTPHeader);
            Thread   rtpThread     = new Thread(new ThreadStart(() => rtpConnection.sendVideo(videoWanted)));

            connectedClientsRTP.Add(session, rtpThread);

            _view.updateClientRequests(rtspPacket);
            _view.updateServerStatus("The client " + ((IPEndPoint)clientSocket.RemoteEndPoint).Address.ToString() + ":" + ((IPEndPoint)clientSocket.RemoteEndPoint).Port.ToString() + " has been joined." + Environment.NewLine);
        }