FileDocCategorySizeDatePackage
Server.javaAPI DocJMF 2.1.1e1545Mon May 12 12:20:56 BST 2003com.sun.media.rtsp

Server

public class Server extends Thread

Fields Summary
private RtspManager
rtspManager
private ServerSocket
serverSocket
Constructors Summary
public Server(RtspManager rtspManager)

        this.rtspManager = rtspManager;

        try {
            serverSocket = new ServerSocket(RtspPort.getPort());

            System.err.println("Server Socket: " + serverSocket.toString());
            System.err.println("Socket is connected to: " +
                    serverSocket.getInetAddress().getLocalHost());
            System.err.println("Local port: " + serverSocket.getLocalPort());
        } catch (IOException e) {
            e.printStackTrace();
        }
    
Methods Summary
public voidrun()

        Debug.println("Server running...");

        if (serverSocket == null) {
            return;
        }

        // TransportRx transportRx;

        while (true) {
            try {
                Debug.println("accepting...");

                Socket socket = serverSocket.accept();

                rtspManager.addConnection(socket);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    
public voidshutdown()

        try {
            Debug.println("...closing server socket");

            serverSocket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }