eandersson/amqpstorm

amqpstorm.exception.AMQPConnectionError: [Errno 9] on Sun Solaris 10

Giuliox opened this issue · 1 comments

Hi, i had this exception:
"Traceback (most recent call last):
File "rpc_server.py", line 10, in
CONNECTION = amqpstorm.Connection('localhost', 'user', 'pass',port=5672)
File "/tmp/test/lib/python3.3/site-packages/amqpstorm/connection.py", line 70, in init
self.open()
File "/tmp/test/lib/python3.3/site-packages/amqpstorm/connection.py", line 190, in open
self._io.open()
File "/tmp/test/lib/python3.3/site-packages/amqpstorm/io.py", line 99, in open
sock_addresses = self._get_socket_addresses()
File "/tmp/test/lib/python3.3/site-packages/amqpstorm/io.py", line 150, in _get_socket_addresses
raise AMQPConnectionError(why)
amqpstorm.exception.AMQPConnectionError: [Errno 9] service name not available for the specified socket type"

trying to run your rpc_server.py exemple on a Sun Solaris 10 VM.

I've roughly solved the problem adding this last parameter to line 145 of "io.py":
"addresses = socket.getaddrinfo(self._parameters['hostname'],self._parameters['port'],family,socket.SOCK_STREAM)"

I hope it can be useful.

Thanks @Giuliox for reporting this.

I'll include this in the next update, slated a week or two from now.