Cannot understand ConnectionRefusedError following examples

#1

I am lost in an error message on my Windows computer.
So I’ve decided to follow documentation and do my own experiments with autobahn, so I put these in a module:

system

import os, sys

vendors

from autobahn import wamp

from autobahn.asyncio.wamp import ApplicationRunner

from autobahn.asyncio.wamp import ApplicationSession

from trollius import coroutine

project

class Session(ApplicationSession):

@coroutine

def onJoin(self, details):

    print("session ready")

class Program:

def __init__(self, host=u'127.0.0.1', port=3002, realm=u'realm'):

    url = u'ws://%s:%d/ws' % (host, port)

    self.runner = ApplicationRunner(url, realm=realm)

def serve(self):

    self.runner.run(Session)

``

Then in another file I do:

program = Program()
program.serve()

``

Then the computer shouts this at me:

Traceback (most recent call last):

File “W:\Workspace\server\bin\run-server.py”, line 25, in

program.serve()

File “W:\Workspace\server\lib\vmix\server.py”, line 20, in serve

self.runner.run(Session)

File “W:\Workspace\server\env\lib\site-packages\autobahn\asyncio\wamp.py”, line 162, in run

(transport, protocol) = loop.run_until_complete(coro)

File “W:\Workspace\server\env\lib\site-packages\trollius\base_events.py”, line 350, in run_until_complete

return future.result()

File “W:\Workspace\vmix\server\env\lib\site-packages\trollius\futures.py”, line 286, in result

raise self._exception

trollius.py33_exceptions.ConnectionRefusedError: [Errno 10061] Connect call failed (‘127.0.0.1’, 3002)

``

There is nothing listening at 127.0.0.1:3002, why connection refused(this is a server) ?
Did I forget something ?

0 Likes

#2

What WAMP router are you using? If it’s Crossbar.io, then what is your config?

···

Am Samstag, 6. Februar 2016 10:49:04 UTC+1 schrieb ionut stoica:

I am lost in an error message on my Windows computer.
So I’ve decided to follow documentation and do my own experiments with autobahn, so I put these in a module:

system

import os, sys

vendors

from autobahn import wamp

from autobahn.asyncio.wamp import ApplicationRunner

from autobahn.asyncio.wamp import ApplicationSession

from trollius import coroutine

project

class Session(ApplicationSession):

@coroutine
def onJoin(self, details):
    print("session ready")

class Program:

def __init__(self, host=u'127.0.0.1', port=3002, realm=u'realm'):
    url = u'ws://%s:%d/ws' % (host, port)
    self.runner = ApplicationRunner(url, realm=realm)
def serve(self):
    self.runner.run(Session)

``

Then in another file I do:

program = Program()
program.serve()

``

Then the computer shouts this at me:

Traceback (most recent call last):

File “W:\Workspace\server\bin\run-server.py”, line 25, in

program.serve()

File “W:\Workspace\server\lib\vmix\server.py”, line 20, in serve

self.runner.run(Session)

File “W:\Workspace\server\env\lib\site-packages\autobahn\asyncio\wamp.py”, line 162, in run

(transport, protocol) = loop.run_until_complete(coro)

File “W:\Workspace\server\env\lib\site-packages\trollius\base_events.py”, line 350, in run_until_complete

return future.result()

File “W:\Workspace\vmix\server\env\lib\site-packages\trollius\futures.py”, line 286, in result

raise self._exception

trollius.py33_exceptions.ConnectionRefusedError: [Errno 10061] Connect call failed (‘127.0.0.1’, 3002)

``

There is nothing listening at 127.0.0.1:3002, why connection refused(this is a server) ?
Did I forget something ?

0 Likes