Java TCP server; timeout exception

The device (Photon Particle) is able to transmit data to the server (my computer); however, it can only transmit 50 data points before timing out. I’m using Java and got to send about 100,000 data points. Any clue on how to fix the timeout exception in my TCPServer code?
BTW: the point of the code is to receive data from a Photon Particle and store it later.

Exception in thread "main" java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at TCPServer.main(TCPServer.java:26)

Java TCPServer code:

import java.io.*;
import java.net.*;

class TCPServer
{
   public static void main(String argv[]) throws Exception
      {
         String clientSentence;
         String capitalizedSentence;
         ServerSocket welcomeSocket = new ServerSocket(6780);
         System.out.println("TCP server running");
         while(true)
         {
            Socket connectionSocket = welcomeSocket.accept();
            BufferedReader inFromClient =
               new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
            DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream());
            clientSentence = inFromClient.readLine();
            
            System.out.println("Received: " + clientSentence);
            capitalizedSentence = clientSentence + '\n';
            outToClient.writeBytes(capitalizedSentence);
           
            while(true)
            {
            clientSentence = inFromClient.readLine();
            if (clientSentence == null)
                break;
                        
            System.out.println("Received: " + clientSentence);
            capitalizedSentence = clientSentence + '\n';
            outToClient.writeBytes(capitalizedSentence);
            }
         }
      }
}

Particle TCPClient code:

int sensor1 = A1;
int sensorV = 0;
char sensorStr[64];
int data;
int i;
char * buffer;

TCPClient client;
byte server[] = { 192,168,2,5}; // IP address

void server_connect()
{
  Serial.println("connecting...");

  if (client.connect(server, 6780))
  {
    Serial.println("connected");
    client.println("HELLO");
  }
  else
  {
    Serial.println("connection failed");
  }
}

void setup()
{
  // Make sure your Serial Terminal app is closed before powering your device
  Serial.begin(9600);
  // Now open your Serial Terminal, and hit any key to continue!
  //while(!Serial.available()) 
  Particle.process();

  server_connect();

}

void loop()
{
    
 // Sleep 1 sec
 // byte[] data = sensor.read();
 // client.println(data);

  if (client.available())
  {
    data = analogRead(sensor1);
          
          Serial.println(data);
          client.println(data);
          delay(100);

  }

  if (!client.connected())
  {
    Serial.println("disconnecting.");
    client.stop();
    server_connect();
  }
}