| Age | Commit message (Collapse) | Author |
|
|
|
User of library that want to create WebSocket client should only focus
to the Endpoint and/or Headers when creating client.
While at it, change handshake test to check for error instead of status
code.
|
|
Unlike HTTP client or other most commmon TCP oriented client, the
WebSocket client is actually asynchronous or passive-active instead of
synchronous.
At any time client connection is open to server, client can receive a
message broadcast from server.
Case examples: if client send "A" to server, and expect that server
response with "A+", server may send message "B" before sending "A+".
Another case is when client connection is open, server may send "B" and
"C" in any order without any request send by client previously.
Due to this model, the way to handle response from server is centralized
using handlers instead of using single send request-response.
|
|
Changes caused by test:
* handlePing become the internal field of client instead of method, so
it can be replaced during test
* add internal context ctxKeyFrame to save the expected frame in handler
|
|
Most of the constants should not be used directly, as we prefer user to
use the functions or methods based access.
|