Socket Exception thrown when trying to make a remote connection to server over adhoc network

68 views
Skip to first unread message

Samuel Nelson

unread,
Jun 11, 2014, 1:53:25 PM6/11/14
to clojure-...@googlegroups.com
I am new to langohr and rabbitmq, and I want to try and use it for sending data across a distributed network.

To test it out, I have two laptops, both connected over and adhoc network and both running rabbitmq and their IP's are set to 10.10.10.3 and 10.10.10.5... I added a rabbitmq username and password "client", "client" on the 10.10.10.3 laptop

From the repl on the 10.10.10.5 laptop, I enter the following command:
(def conn (langohr.core/connect { :host "10.10.10.3"
                                                :username "client"
                                                :password "client"}))

And after a few seconds, it gives me the following exception:
SocketException Connection reset  java.net.SocketInputStream.read (SocketInputStream.java:185)

I know that it isn't the network because the log file on the 10.10.10.3 laptop says something like :
accepting amqp connection: <0.209.0>  (10.10.10.5:46647 -> 10.10.10.3:5672)

Any idea what could be causing this exception?

also, will langohr and rabbitmq work on embedded ARM processors?



This information is intended solely for the use of the individual to whom it is addressed. 
Any review, disclosure, copying, distribution or use of this e-mail communication by 
others is strictly prohibited.  If you are  not the intended recipient, please notify us 
immediately by returning  this message to the sender and delete all copies.

Samuel Nelson

unread,
Jun 11, 2014, 1:57:09 PM6/11/14
to clojure-...@googlegroups.com
sorry about the last one, I posted prematurely on accident.   here is the stack trace:
CompilerException java.io.IOException, compiling:(NO_SOURCE_FILE:1:10)
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3558)
    clojure.lang.Compiler$DefExpr.eval (Compiler.java:417)
    clojure.lang.Compiler.eval (Compiler.java:6708)
    clojure.lang.Compiler.eval (Compiler.java:6666)
    clojure.core/eval (core.clj:2927)
    clojure.main/repl/read-eval-print--6625/fn--6628 (main.clj:239)
    clojure.main/repl/read-eval-print--6625 (main.clj:239)
    clojure.main/repl/fn--6634 (main.clj:257)
    clojure.main/repl (main.clj:257)
    clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--1308 (interruptible_eval.clj:56)
    clojure.core/apply (core.clj:624)
    clojure.core/with-bindings* (core.clj:1862)
Caused by:
IOException
    com.rabbitmq.client.impl.AMQChannel.wrap (AMQChannel.java:106)
    com.rabbitmq.client.impl.AMQChannel.wrap (AMQChannel.java:102)
    com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc (AMQChannel.java:124)
    com.rabbitmq.client.impl.AMQConnection.start (AMQConnection.java:374)
    com.rabbitmq.client.ConnectionFactory.newConnection (ConnectionFactory.java:590)
    com.novemberain.langohr.Connection.init (Connection.java:107)
    langohr.core/connect (core.clj:93)
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3553)
    clojure.lang.Compiler$DefExpr.eval (Compiler.java:417)
    clojure.lang.Compiler.eval (Compiler.java:6708)
    clojure.lang.Compiler.eval (Compiler.java:6666)
Caused by:
ShutdownSignalException connection error
    com.rabbitmq.utility.ValueOrException.getValue (ValueOrException.java:67)
    com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue (BlockingValueOrException.java:33)
    com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply (AMQChannel.java:343)
    com.rabbitmq.client.impl.AMQChannel.privateRpc (AMQChannel.java:216)
Caused by:
SocketException Connection reset

Michael Klishin

unread,
Jun 11, 2014, 2:00:54 PM6/11/14
to Samuel Nelson, clojure-...@googlegroups.com
On 11 June 2014 at 21:57:11, Samuel Nelson (snel...@ycp.edu) wrote:
> > Caused by:
> SocketException Connection reset

This message is very generic and does not explain much. Can you see connection
entries in RabbitMQ log? Try connecting to RabbitMQ via telnet, for example
(note that it will quickly close connection unless
you enter a valid protocol header, "AMQP091", and then due to connection
negotiation timeout). 
--
MK

Software Engineer, Pivotal/RabbitMQ

Samuel Nelson

unread,
Jun 11, 2014, 2:34:42 PM6/11/14
to clojure-...@googlegroups.com, snel...@ycp.edu
I tested via telnet: telnet 10.10.10.3 5672 and the rabbitMQ server reports in the log that it accepted the connection 10.10.10.5:46899 -> 10.10.10.3:5672.
Then the connection times out and an error log is written: Closing AMQP connection 10.10.10.5:46899 -> 10.10.10.3:5672.

However, when I run the Clojure/Langohr code, the log file accepts the connection, but does not attempt to close. Instead we have the SocketException on the client side, 10.10.10.5, which I listed in the first post.

Thanks!

Samuel Nelson

unread,
Jun 18, 2014, 11:17:46 AM6/18/14
to clojure-...@googlegroups.com, snel...@ycp.edu
Any idea what the possible causes of this problem are?  sorry I know its not much information to work with..
Reply all
Reply to author
Forward
0 new messages