TCP Video file transfer
<p>I'm trying to make a video file transfer but am having problems getting the server to start sending bytes. </p>

<p>The first step is for the client to connect, the socket gets accepted. Then the client sends the video file name but the server never reads this.</p>

<p>This is the code for the server up until it blocks:</p>

<pre><code> try(ServerSocket serverSocket = new ServerSocket(4005))
    {
        Socket socket = serverSocket.accept();
        System.out.println("accepted");
        OutputStream os = socket.getOutputStream();

        BufferedReader receiveReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        System.out.println("This gets printed");
        String request = receiveReader.readLine();//never passes this line
        System.out.println("This doesn't get printed");
</code></pre>

<p>and this is the client up until it blocks waiting for the server to send the video bytes:</p>

<pre><code> try(Socket socket = new Socket(IPAddress, 4005))
            {
                byte[] messageBytes = new byte[10000];

                DataOutputStream outputStream = new DataOutputStream(socket.getOutputStream());
                outputStream.writeBytes("REQUEST;"+videoPath);//This is the line that should send the bytes for the server to read, so it won't block.

                String home = System.getProperty("user.home");
                String path = home+"\\Downloads" + videoName; 
                path = path.trim();
                FileOutputStream fos = new FileOutputStream(path);
                BufferedOutputStream bos = new BufferedOutputStream(fos);
                InputStream is = socket.getInputStream();

                int bytesRead = 0;
                System.out.println("Downloading file...");
                while((bytesRead = is.read(messageBytes))!=-1)//This blocks here
</code></pre>

<p>Why on earth isn't the server reading the <code>"Request" + videoPath</code> bytes that the server is sending? I tried <code>outputStream.flush()</code> as well, no luck.</p>