-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a general-purpose websocket client #128
base: master
Are you sure you want to change the base?
Conversation
class WebSocketClientTest : ShouldSpec() { | ||
override fun isolationMode(): IsolationMode? = IsolationMode.InstancePerLeaf | ||
|
||
private val wsPort = Random.nextInt(1024, 65535).also { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
No description provided.