Skip to content

Implement a general-purpose websocket client#128

Open
bbaldino wants to merge 4 commits intojitsi:masterfrom
bbaldino:ws-client
Open

Implement a general-purpose websocket client#128
bbaldino wants to merge 4 commits intojitsi:masterfrom
bbaldino:ws-client

Conversation

@bbaldino
Copy link
Member

No description provided.

class WebSocketClientTest : ShouldSpec() {
override fun isolationMode(): IsolationMode? = IsolationMode.InstancePerLeaf

private val wsPort = Random.nextInt(1024, 65535).also {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail randomly because of colisions. Do you know if there's a way to make ktor bind on an ephemeral port?

println("Server running on port $it")
}

private val client = HttpClient(CIO) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is redundant (since WebSocketClient defaults to the same) or defined here for reuse?

Thread.sleep(1000)
ws.sendString("hello")
ws.stop()
Thread.sleep(1000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this test for, just lack of exceptions? Are both sleep calls necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants