Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kUdpClient.h
Go to the documentation of this file.
1
10 #ifndef K_API_UDP_CLIENT_H
11 #define K_API_UDP_CLIENT_H
12
13 #include <kApi/Io/kNetwork.h>
14 #include <kApi/Io/kUdpClient.x.h>
15
22 //typedef kStream kUdpClient; --forward-declared in kApiDef.x.h
23
33 kFx(kStatus) kUdpClient_Construct(kUdpClient* client, kIpVersion ipVersion, kAlloc allocator);
34
44 kFx(kStatus) kUdpClient_Bind(kUdpClient client, kIpAddress address, k32u port);
45
61 kFx(kStatus) kUdpClient_ReadFrom(kUdpClient client, kIpEndPoint* endPoint, void* buffer, kSize capacity, kSize* received, k64u timeout);
62
78 kFx(kStatus) kUdpClient_WriteTo(kUdpClient client, const void* buffer, kSize size, kIpAddress address, k32u port, k64u timeout);
79
94 kFx(kStatus) kUdpClient_Receive(kUdpClient client, kIpEndPoint* endPoint, kSize* received, k64u timeout);
95
114 kFx(kStatus) kUdpClient_ReceiveEx(kUdpClient client, kIpEndPoint* endPoint, kSize* received, k64u timeout, kSize* index);
115
134 kFx(kStatus) kUdpClient_Send(kUdpClient client, kIpAddress address, k32u port, k64u timeout, kBool clear);
135
142 kFx(kStatus) kUdpClient_Clear(kUdpClient client);
143
157 kFx(kStatus) kUdpClient_EnableBroadcast(kUdpClient client, kBool broadcast);
158
169 kFx(kStatus) kUdpClient_EnablePacketInfo(kUdpClient client, kBool enabled);
170
185 kFx(kStatus) kUdpClient_EnableBroadcastReceive(kUdpClient client, kBool broadcast);
186
203 kFx(kStatus) kUdpClient_EnableReuseAddress(kUdpClient client, kBool reuse);
204
226 kFx(kStatus) kUdpClient_SetWriteBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize);
227
246 kFx(kStatus) kUdpClient_SetReadBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize);
247
255 kFx(kSocket) kUdpClient_Socket(kUdpClient client);
256
265 kFx(kStatus) kUdpClient_LocalEndPoint(kUdpClient client, kIpEndPoint* endPoint);
266
267 #endif
k32u
Represents a 32-bit unsigned integer.
kUdpClient::kUdpClient_Construct
kStatus kUdpClient_Construct(kUdpClient *client, kIpVersion ipVersion, kAlloc allocator)
Constructs a UDP client object.
k64u
Represents a 64-bit unsigned integer.
kIpVersion
Represents an Internet Protocol version.
kUdpClient::kUdpClient_Bind
kStatus kUdpClient_Bind(kUdpClient client, kIpAddress address, k32u port)
Binds the client to a local IP address and/or port.
kUdpClient::kUdpClient_Socket
kSocket kUdpClient_Socket(kUdpClient client)
Returns the underlying kSocket object.
kUdpClient::kUdpClient_WriteTo
kStatus kUdpClient_WriteTo(kUdpClient client, const void *buffer, kSize size, kIpAddress address, k32u port, k64u timeout)
Blocks until the provided datagram is written to the underlying socket (or until a timeout occurs)...
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kIpAddress
Represents an IP address.
Definition: kNetwork.h:36
kUdpClient::kUdpClient_EnablePacketInfo
kStatus kUdpClient_EnablePacketInfo(kUdpClient client, kBool enabled)
Enables or disables packet information for datagrams.
kUdpClient::kUdpClient_LocalEndPoint
kStatus kUdpClient_LocalEndPoint(kUdpClient client, kIpEndPoint *endPoint)
Returns the local end point for a bound client.
kSSize
Represents a signed integer that can store a pointer address.
kUdpClient::kUdpClient_Clear
kStatus kUdpClient_Clear(kUdpClient client)
Clears the internal write buffer state.
kUdpClient::kUdpClient_SetReadBuffers
kStatus kUdpClient_SetReadBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize)
Sets the size of read buffers.
kUdpClient::kUdpClient_ReceiveEx
kStatus kUdpClient_ReceiveEx(kUdpClient client, kIpEndPoint *endPoint, kSize *received, k64u timeout, kSize *index)
Blocks until a datagram is received into kUdpClient's read buffer (or until a timeout occurs) and rep...
kUdpClient::kUdpClient_Receive
kStatus kUdpClient_Receive(kUdpClient client, kIpEndPoint *endPoint, kSize *received, k64u timeout)
Blocks until a datagram is received into kUdpClient's read buffer (or until a timeout occurs)...
kUdpClient
Represents a UDP client.
kUdpClient::kUdpClient_EnableBroadcast
kStatus kUdpClient_EnableBroadcast(kUdpClient client, kBool broadcast)
Enables or disables broadcasting.
kUdpClient::kUdpClient_EnableBroadcastReceive
kStatus kUdpClient_EnableBroadcastReceive(kUdpClient client, kBool broadcast)
Enables the ability to receive broadcast messages.
kUdpClient::kUdpClient_EnableReuseAddress
kStatus kUdpClient_EnableReuseAddress(kUdpClient client, kBool reuse)
Enables or disables reuse of a local end point within a short period of time.
kNetwork.h
IP networking definitions.
kStatus
Represents an error code.
kUdpClient::kUdpClient_Send
kStatus kUdpClient_Send(kUdpClient client, kIpAddress address, k32u port, k64u timeout, kBool clear)
Blocks until the datagram in kUdpClient's internal write buffer is written to the underlying socket (...
kIpEndPoint
Represents an IP end point (address, port).
Definition: kNetwork.h:168
kUdpClient::kUdpClient_ReadFrom
kStatus kUdpClient_ReadFrom(kUdpClient client, kIpEndPoint *endPoint, void *buffer, kSize capacity, kSize *received, k64u timeout)
Blocks until a datagram is received into the provided buffer (or until a timeout occurs).
kUdpClient::kUdpClient_SetWriteBuffers
kStatus kUdpClient_SetWriteBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize)
Sets the size of write buffers.
kSocket
Represents a network socket.
kBool
Represents a boolean value.