Code example for Socket

Methods: getLocalAddress, getLocalPort

0
			/* ********************************************************************************** */ 
			/* ********************************** Method PLAY *********************************** */ 
			/* ********************************************************************************** */ 
			else if (request.method.toUpperCase().equals("PLAY")) {
				String requestAttributes = "RTP-Info: ";
				if (session.trackExists(0)) requestAttributes += "url=rtsp://"+client.getLocalAddress().getHostAddress()+":"+client.getLocalPort()+"/trackID="+0+";seq=0,";
				if (session.trackExists(1)) requestAttributes += "url=rtsp://"+client.getLocalAddress().getHostAddress()+":"+client.getLocalPort()+"/trackID="+1+";seq=0,";
				requestAttributes = requestAttributes.substring(0, requestAttributes.length()-1) + "\r\nSession: 1185d20035702ca\r\n";
				 
				response.attributes = requestAttributes;
 
				// If no exception has been thrown, we reply with OK 
				response.status = Response.STATUS_OK;
			 
			} 
 
 
			/* ********************************************************************************** */ 
			/* ********************************** Method PAUSE ********************************** */ 
			/* ********************************************************************************** */ 
			else if (request.method.toUpperCase().equals("PAUSE")) {