Java TCP client repetitive connections result in EMFILE error

My Java application establishes TCP connection with a server and communicates with it every second by sending and receiving messages. Both server and client are run on the same Mac. In about 15-20 minutes, my server crashes with error “Errno::EMFILE Too many files open”. Here is my client code:

package testtcp;

import java.awt.Dimension;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;


public class TestTCP extends  JPanel
{
    JFrame frame = new JFrame("Button Demo");

    ScheduledExecutorService executorService;

    private Socket socket = null;
    private DataInputStream input = null;
    private DataOutputStream output = null;
    private BufferedReader br = null;

    private boolean isMapUpdating = false;


    public TestTCP() 
    {
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setPreferredSize(new Dimension(300,300));
        frame.add(this);

        JButton b1 = new JButton("BLACK");
        b1.setPreferredSize(new Dimension(150,50));
        b1.setFocusPainted(false); // get rid of border around text
        add(b1);
        b1.addActionListener((java.awt.event.ActionEvent evt) -> 
        {
            startAcarsConnection();
        });

        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);

    }


    public void startAcarsConnection()
    {
        start();

    }

    public void start() 
    {
        System.out.println("THREAD START");

        // Default timer rate
        int timerRate = 1;

        executorService = Executors.newSingleThreadScheduledExecutor();

        executorService.scheduleAtFixedRate(new Runnable() 
        {
            @Override
            public void run() 
            {
                // Create new TCP connection if the map is not currently updating
                if(isMapUpdating == false)
                {
                    isMapUpdating = true;

                    communicateWithServer();
                }
            }
        }, 0, timerRate, TimeUnit.SECONDS);
    }


    public void stop() 
    {
        executorService.shutdown();
    }

    public void communicateWithServer()
    {
        // Create a message to the server
        String messageToServer = makeMessageToServer();

        // Connect to the client and receive the response    
        String messageFromServer = connectToClient(messageToServer);

        SwingUtilities.invokeLater(() ->
        {
            messageReceived(messageFromServer);
        });

    }


    public String connectToClient(String messageToServer)
    {
        String data = "";
        // Message from the server that should terminate TCP connection
        String  terminator = "END_IGOCONNECT_DATA";

        try
        {
            // Create socket and streams
            socket = new Socket("192.168.1.2", 7767);
            input = new DataInputStream( socket.getInputStream());
            output = new DataOutputStream( socket.getOutputStream());

            //Send message to the server
            output.writeBytes(messageToServer);


            System.out.println("MESSAGE TO SERVER FROM CONNECT TO CLIENT: "+messageToServer);


            //Read Response
            br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            StringBuilder sb = new StringBuilder();
            String s = "";
            int value;

            // Process the message from the server and add to the StringBuilder
            while((value = br.read()) != -1) 
            {
                // converts int to character
                char c = (char)value;

                sb.append(c);

                if(sb.toString().contains(terminator))
                {
                    break;
                }
            }

            // Create the final string
            data = sb.toString();
        }

        catch (UnknownHostException e)
        {
            System.out.println("Sock:"+e.getMessage());

            // Close Connection
            cancelConnection();

            // Pop-up message that the airport was not found
            String message = "Application was not able to establish connection with X-Plane.n"
                    + "Check whether IP Address and Port number were correctly entered in Settings.n"
                    + "Check whether connection is not being blocked by your firewall.";
            JOptionPane.showMessageDialog(new JFrame(), message, "TCP Connection Error: UnknownHostException",
            JOptionPane.ERROR_MESSAGE);

            data = "ERROR";
        }

        catch (EOFException e)
        {
            System.out.println("EOF:"+e.getMessage()); 

            // Close Connection
            cancelConnection();

            // Pop-up message that the airport was not found
            String message = "Application was not able to establish connection with X-Plane.n"
                    + "Check whether IP Address and Port number were correctly entered in Settings.n"
                    + "Check whether connection is not being blocked by your firewall.";
            JOptionPane.showMessageDialog(new JFrame(), message, "TCP Connection Error: EOFException",
            JOptionPane.ERROR_MESSAGE);

            data = "ERROR";
        }

        catch (IOException e)
        {
            System.out.println("IO:"+e.getMessage());

            // Close Connection
            cancelConnection();

            // Pop-up message that the server was not found
            if(!e.getMessage().equals("Socket closed"))
            {
                String message = "Application was not able to establish connection with X-Plane.n"
                    + "Check whether IP Address and Port number were correctly entered in Settings.n"
                    + "Check whether connection is not being blocked by your firewall.";
                JOptionPane.showMessageDialog(new JFrame(), message, "TCP Connection Error: IOException",
                JOptionPane.ERROR_MESSAGE);
            }
            // "Connection reset"

            data = "ERROR";
        }

        finally 
        {
            // TO DO!!! DISABLED FOR NOW!! closeSocketPax();
        }

        return data;
    } 


    public void cancelConnection()
    {

        executorService.shutdown();

        closeSocketPax();

        SwingUtilities.invokeLater(() ->
        {
            System.out.println("Cancel Connection");
        });
    }


    private void closeSocketPax()
    {
        try
        {   
            if(socket!=null) { socket.close();}
            if(input != null) { input.close();}
            if(output != null) { output.close();}
            if(br != null) { br.close();}
        }
        catch (IOException ex) 
        {
            String message = "Error closing socket.";
            JOptionPane.showMessageDialog(new JFrame(), message, "TCP Connection Error: IOException",
            JOptionPane.ERROR_MESSAGE);
        }
        socket = null;
        input = null;
        output = null;
        br = null;
    }

    private String makeMessageToServer()
    {
        return "MESSAGE TO SERVER";
    }

    private void messageReceived(String message)
    {
        System.out.println("MESSAGE RECEIVED: "+message);

        isMapUpdating = false;
    }


    public static void main(String[] args) 
    {    
       new TestTCP();
   }
}

I have been trying to solve this for almost a month already!
Does anyone see a problem in the code and know how to mitigate the problem? Greatly appreciated!