- 최신
- 최다 투표
- 가장 많은 댓글
@jsola we are using WebSocketApi for one of our Dashboards, and the connection handling is quite seamless.
If you can share your infra code for the WebSocketApi, and the Client code making the connections, I can try to help find the issue you are facing.
Thank you for your reply. In our case, the connection works perfectly unless the client loose the connection, i don't have the code, but is an android service and when the device loose the internet access, it close the connection with the socket(may be the problem is there), but the WebsocketApi does not know that the device has close the connection, then, the connection for the SocketApi still alive but it is false.
From our server side the problem is that from the lambda which try to do the post to the connection the api don't throw any error or if i try to get the connection from that device i receive connection info
static async run(connectionId) {
const apiGateway = new ApiGatewayManagementApi({
endpoint: Config.API_DOMAIN,
})
return await apiGateway
.getConnection(
{
ConnectionId: connectionId
}
)
.promise();
}
I receive
{
ConnectedAt: 2023-02-17T11:11:55.344Z,
Identity: {
SourceIp: 'xxx.xxx.xxx.xxx',
UserAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36'
},
LastActiveAt: 2023-02-17T11:11:55.344Z
}
I think the only way to work with this case i make a workaround playing with the idle connections o client pings and disconnect manually if the server don't receive any ping from the client.(I don't like the solution mainly because is not a solution) but i think that with the actual WebsocketApi behavior is the only way Thank you