Hi,
im trying to connect to a friends remote server using the following code:
Enter
loop = asyncio.get_event_loop()
def on_message(message: IncomingMessage):
with message.process():
print("[x] %r" % message.body)
async def main():
# Perform connection
connection = await connect(host=rabbit_url, port=rabbit_port,
login=rabbit_user, password=rabbit_password, loop=loop)
# Creating a channel
channel = await connection.channel()
await channel.set_qos(prefetch_count=1)
logs_exchange = await channel.declare_exchange(
'delalis',
ExchangeType.FANOUT
)
# Declaring queue
queue = await channel.declare_queue(exclusive=True)
# Binding the queue to the exchange
await queue.bind(logs_exchange)
# Start listening the queue with name 'task_queue'
await queue.consume(on_message)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.create_task(main())
# we enter a never-ending loop that waits for data
# and runs callbacks whenever necessary.
print(' [*] Waiting for logs. To exit press CTRL+C')
loop.run_forever()
and im getting an error :
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Any help would appreciated.
Thanks.