Howto ask a component to close cleanly

hi
may be i missed something but i can not close cleanly a wamp component

import asyncio
import time

from autobahn.asyncio import component

comp = component.Component(
    transports=dict(
        type='rawsocket',
        url='rs://127.0.0.1:8081',
    ),
    realm='test',
)

@comp.on_join
async def _(session, details):
    await asyncio.sleep(2)
    await comp.stop()

component.run([comp])

the result is

2022-03-03T16:44:57 session leaving 'wamp.close.normal'
2022-03-03T16:44:57 Connection failed: TransportLost: failed to complete connection

thanks

it works well if i use websocket instead

....
    transports=dict(
        type='websocket',
        url='ws://127.0.0.1:8080/ws',
    ),
....

the result is:

2022-03-03T17:00:56 session leaving 'wamp.close.normal'

so in both cases looks good?

hi tobias
using rawsocket, the component always try to reconnect and never stops

2022-03-04T15:21:01 ApplicationSession started.
2022-03-04T15:21:03 session leaving 'wamp.close.normal'
2022-03-04T15:21:03 Connection failed: TransportLost: failed to complete connection
2022-03-04T15:21:05 ApplicationSession started.
2022-03-04T15:21:07 session leaving 'wamp.close.normal'
2022-03-04T15:21:07 Connection failed: TransportLost: failed to complete connection
^C2022-03-04T15:21:09 Shutting down due to SIGINT

ah, right! I mean, it shouldn’t reconnect when closed orderly before. I posted an issue, pls feel free to comment or similar https://github.com/crossbario/autobahn-python/issues/1530