private void send_RTSP_request(String request_type) { try{ //Use the RTSPBufferedWriter to write to the RTSP socket //write the request line: RTSPBufferedWriter.write(request_type); //write the CSeq line: RTSPBufferedWriter.write(RTSPSeqNb); //check if request_type is equal to "SETUP" and in this case write the Transport: line advertising to the server the port used to receive the RTP packets RTP_RCV_PORT //otherwise, write the Session line from the RTSPid field if(request_type.equals("SETUP")){ RTSPBufferedWriter.write(RTP_RCV_PORT); } else { RTSPBufferedWriter.write(RTSPid); } RTSPBufferedWriter.flush(); } catch(Exception ex) { System.out.println("Exception caught: "+ex); System.exit(0); } }