1-我试图订阅一个特定的频道,并从一个服务器获得一个长轮询,但我收到一个客户端未知错误402。以前有人面对过这个问题吗?代码中有什么遗漏吗
import asyncio
from aiocometd import Client
import aiocometd.exceptions as cometd_exc
from aiocometd import Client, ConnectionType
IP= "x.x.x.x"
#握手
异步def main():
async with Client("http://"+IP+":8081/events/server/cometd",connection_timeout=60 , connection_types=ConnectionType.LONG_POLLING) as client:
await client.subscribe("/events/rest/alarmEvent")
async for message in client:
print(message)
try:
message = await client.receive()
except TransportTimeoutError:
print("Connection is lost with the server. "
"Couldn't reconnect in 60 seconds.")
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
'Error code 402 //Unknown Client'
目前没有回答
相关问题 更多 >
编程相关推荐