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()+":"+client.getLocalPort()+"/trackID="+0+";seq=0;rtptime=0,";
				if (session.trackExists(1)) requestAttributes += "url=rtsp://"+client.getLocalAddress()+":"+client.getLocalPort()+"/trackID="+1+";seq=0;rtptime=0,";
				requestAttributes = requestAttributes.substring(0, requestAttributes.length()-1) + "\r\nSession: 1185d20035702ca\r\n";
				 
				response.status = Response.STATUS_OK;
				response.attributes = requestAttributes;
			} 
 
 
			/* ********************************************************************************** */ 
			/* ********************************** Method PAUSE ********************************** */ 
			/* ********************************************************************************** */ 
			else if (request.method.toUpperCase().equals("PAUSE")) {
				response.status = Response.STATUS_OK;
			}