I'm trying to test my websocket client logic, so I'd like to create a websocket server which only lives for the duration of the test. However, there doesn't seem to be a way to create a server which only lives for a certain period of time. The Server struct is public, but the Server.accept is not, so even if I create my own server that I can deinit whenever I want, I can't connect it to a Handler.
(Should note that even though Sever.handle is public, that'd mean I have to reimplement all of the handshake logic myself since I need to provide it with an already-created connection handler)
I'm trying to test my websocket client logic, so I'd like to create a websocket server which only lives for the duration of the test. However, there doesn't seem to be a way to create a server which only lives for a certain period of time. The
Server
struct is public, but theServer.accept
is not, so even if I create my own server that I can deinit whenever I want, I can't connect it to aHandler
.(Should note that even though
Sever.handle
is public, that'd mean I have to reimplement all of the handshake logic myself since I need to provide it with an already-created connection handler)