Hi I want to make a calculator with server, so after I click the numbers and the operator, the two numbers and the operator will be sent to the server.
And in server the calculation will be done and then the result is send back to the client.
But the code I made just can do the calculation one time, and it will disconnect. I want it to be always connect so I can do another calculation.

And this is a part of my code (in the client side (GUI)):
Java Code:
ConSocket cs = new ConSocket();

    private void jButtonEqualsActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
        number2 = reader();
  
        try {
            cs.sock = new Socket("localhost", 10005);
            
            cs.oos = new ObjectOutputStream(cs.sock.getOutputStream());
            cs.ois = new ObjectInputStream(cs.sock.getInputStream());

            if(addc>0) {
                SendData sd = new SendData(number1, number2, "+");
                cs.oos.writeObject(sd);
                cs.oos.flush();
                result = (Double)cs.ois.readDouble();
                text.setText(Double.toString(result));
            }...
and this is in the server side:
Java Code:
public static void main(String[] args) {
        Socket sock = null;
        ObjectOutputStream oos = null;
        ObjectInputStream ois = null;
        try {
            ServerSocket ss = new ServerSocket(10005);
            System.out.println("클라이언트의 접속에 대기합니다.");
            sock = ss.accept();
          
            oos = new ObjectOutputStream(sock.getOutputStream());
            ois = new ObjectInputStream(sock.getInputStream());

            Object obj = null;
            keepConnect:
                while(true){
            obj = ois.readObject();
            SendData sd = (SendData) obj;
            double number1 = sd.getNumber1();
            double number2 = sd.getNumber2();
            String opcode = sd.getOpcode();
            if(opcode.equals("+")) {
                oos.writeDouble(number1+number2);
                oos.flush();
            }...
            System.out.println("결과를 전송했습니다.");
            sock = ss.accept();
            break keepConnect;
            }
        }
I've tried to use setKeepAlive(true), but I didn't see any difference. So any help would be greatly appreciated ^^

Thank you