title: RabbitMQ new connection refused due to SocketException
body: <p>while trying to create a new connection to rabbitmq running on a different server, I got the following error:</p>
  
  <pre><code>java.io.IOException
  at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
  at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
  at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124)
  at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:406)
  at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:516)
  at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:533)
  
  
  Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.net.SocketException: Connection reset
  
  
  at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
  at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
  at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:343)
  at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:216)
  at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118)
  
  
  
  Caused by: java.net.SocketException: Connection reset
  at java.net.SocketInputStream.read(Unknown Source)
  at java.net.SocketInputStream.read(Unknown Source)
  at java.io.BufferedInputStream.fill(Unknown Source)
  at java.io.BufferedInputStream.read(Unknown Source)
  at java.io.DataInputStream.readUnsignedByte(Unknown Source)
  at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
  at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
  at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:533)
  </code></pre>
  
  <hr>
  
  <blockquote>
    <p>Steps taken : </p>
  </blockquote>
  
  <ul>
  <li>rabbitmq is running on the server.  </li>
  <li>server is specified </li>
  <li>default port is specified</li>
  </ul>
  
  <blockquote>
    <p>lsof -i tcp:5672</p>
  </blockquote>
  
  <p>COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME</p>
  
  <p>beam.smp 3084 rabbitmq   15u  IPv6  18611      0t0  TCP *:amqp (LISTEN)</p>
  
  <blockquote>
    <p>rabbitmqctl list_connections</p>
  </blockquote>
  
  <p>Listing connections ...
  guest   client_server   55765   running
  ...done.</p>
  
  <blockquote>
    <p>netstat -tapnl | grep 5672</p>
  </blockquote>
  
  <p>tcp        0      0 0.0.0.0:15672               0.0.0.0:*                   LISTEN      3084/beam.smp</p>
  
  <p>tcp        0      0 0.0.0.0:55672               0.0.0.0:*                   LISTEN      3084/beam.smp</p>
  
  <p>tcp        0      0 :::5672                     :::*                        LISTEN      3084/beam.smp</p>