10 #ifndef K_API_WEBSOCKET_H
11 #define K_API_WEBSOCKET_H
25 #define kWEB_SOCKET_DATA_TYPE_NULL (0x0)
26 #define kWEB_SOCKET_DATA_TYPE_UTF8 (0x1)
27 #define kWEB_SOCKET_DATA_TYPE_BINARY (0x2)
30 #include <kApi/Io/kWebSocket.x.h>
kStatus kWebSocket_Cancel(kWebSocket webSocket)
Cancels any pending I/O operations.
Represents a 32-bit unsigned integer.
k64u kWebSocket_LastPong(kWebSocket webSocket)
Reports the time at which the most recent pong message arrived.
Represents an in-memory stream.
kStatus kWebSocket_SetWriteBuffers(kWebSocket webSocket, kSSize socketSize, kSSize clientSize)
Sets the size of write buffers.
Represents a 64-bit unsigned integer.
kWebSocketDataType kWebSocket_SendType(kWebSocket webSocket)
Reports the message data type currently used for sending.
kStatus kWebSocket_WriteMessage(kWebSocket webSocket, const void *buffer, kSize size)
Writes a complete WebSocket message.
Represents Websocket message content type.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kStatus kWebSocket_Send(kWebSocket webSocket)
Sends any buffered data and ends the current message.
kStatus kWebSocket_ReadMessage(kWebSocket webSocket, kMemory memory, k64u timeout)
Blocks until a whole message has been read (or until a timeout occurs).
Represents an IP address.
Definition: kNetwork.h:37
Represents a single unit (byte) in a UTF-8 character.
kStatus kWebSocket_SetSendType(kWebSocket webSocket, kWebSocketDataType type)
Sets the data transfer type used for send operations.
Represents a signed integer that can store a pointer address.
Core Zen type declarations.
Represents a 32-bit signed integer.
IP networking definitions.
Represents an error code.
kWebSocketDataType kWebSocket_ReceiveType(kWebSocket webSocket)
Reports the data type of the most recently received data message.
kStatus kWebSocket_Construct(kWebSocket *webSocket, kAlloc allocator)
Constructs a WebSocket that can be used to connect to a server.
kStatus kWebSocket_SendPing(kWebSocket webSocket)
Sends a ping message.
kStatus kWebSocket_Close(kWebSocket webSocket)
Closes the WebSocket connection.
kStatus kWebSocket_SetReadBuffers(kWebSocket webSocket, kSSize socketSize, kSSize clientSize)
Sets the size of the read buffers.
kStatus kWebSocket_Receive(kWebSocket webSocket, k64u timeout)
Blocks until a new message is available for reading.
kStatus kWebSocket_Connect(kWebSocket webSocket, kIpAddress address, k32u port, const kChar *host, const kChar *uri, k64u timeout)
Connects a WebSocket to an HTTP server.