title: Java Sockets Connection refused error
body: <p>I am trying to use sockets to connect to a server. I'm using Intellij IDEA  and a JAVAFX project on Ubuntu. I am currently facing this error:</p>
  
  <p><strong>" Caused by: java.net.ConnectException: Connection refused"</strong></p>
  
  <p>The code that this error is pointing to is:</p>
  
  <pre><code>Socket serverSocket = new Socket("127.0.0.1", 8080);
          ConnectionHandler handler = new ConnectionHandler(serverSocket);
          String[] dirs = handler.receiveDirs();
          System.out.println(dirs[0]);
  </code></pre>
  
  <p>If someone can please help me out and tell me what possible problems there could be, and please let me know any possible fixes! Thanks! </p>