Zen API
 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 
15 kBeginHeader()
16 
17 
23 //typedef kStream kUdpClient; --forward-declared in kApiDef.x.h
24 
25 
34 kFx(kStatus) kUdpClient_Construct(kUdpClient* client, kIpVersion ipVersion, kAlloc allocator);
35 
45 kFx(kStatus) kUdpClient_Bind(kUdpClient client, kIpAddress address, k32u port);
46 
62 kFx(kStatus) kUdpClient_ReadFrom(kUdpClient client, kIpEndPoint* endPoint, void* buffer, kSize capacity, kSize* received, k64u timeout);
63 
79 kFx(kStatus) kUdpClient_WriteTo(kUdpClient client, const void* buffer, kSize size, kIpAddress address, k32u port, k64u timeout);
80 
95 kFx(kStatus) kUdpClient_Receive(kUdpClient client, kIpEndPoint* endPoint, kSize* received, k64u timeout);
96 
115 kFx(kStatus) kUdpClient_Send(kUdpClient client, kIpAddress address, k32u port, k64u timeout, kBool clear);
116 
123 kFx(kStatus) kUdpClient_Clear(kUdpClient client);
124 
138 kFx(kStatus) kUdpClient_EnableBroadcast(kUdpClient client, kBool broadcast);
139 
155 
173 
195 kFx(kStatus) kUdpClient_SetWriteBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize);
196 
215 kFx(kStatus) kUdpClient_SetReadBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize);
216 
224 kFx(kSocket) kUdpClient_Socket(kUdpClient client);
225 
234 kFx(kStatus) kUdpClient_LocalEndPoint(kUdpClient client, kIpEndPoint* endPoint);
235 
236 kEndHeader()
237 
238 #include <kApi/Io/kUdpClient.x.h>
239 
240 #endif
Represents a 32-bit unsigned integer.
kStatus kUdpClient_Construct(kUdpClient *client, kIpVersion ipVersion, kAlloc allocator)
Constructs a UDP client object.
Represents a 64-bit unsigned integer.
Represents an Internet Protocol version.
kStatus kUdpClient_Bind(kUdpClient client, kIpAddress address, k32u port)
Binds the client to a local IP address and/or port.
kSocket kUdpClient_Socket(kUdpClient client)
Returns the underlying kSocket object.
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)...
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
Represents an IP address.
Definition: kNetwork.h:38
kStatus kUdpClient_LocalEndPoint(kUdpClient client, kIpEndPoint *endPoint)
Returns the local end point for a bound client.
Represents a signed integer that can store a pointer address.
kStatus kUdpClient_Clear(kUdpClient client)
Clears the internal write buffer state.
kStatus kUdpClient_SetReadBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize)
Sets the size of read buffers.
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)...
Represents a UDP client.
kStatus kUdpClient_EnableBroadcast(kUdpClient client, kBool broadcast)
Enables or disables broadcasting.
kStatus kUdpClient_EnableBroadcastReceive(kUdpClient client, kBool broadcast)
Enables the ability to receive broadcast messages.
kStatus kUdpClient_EnableReuseAddress(kUdpClient client, kBool reuse)
Enables or disables reuse of a local end point within a short period of time.
IP networking definitions.
Represents an error code.
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 (...
Represents an IP end point (address, port).
Definition: kNetwork.h:170
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).
kStatus kUdpClient_SetWriteBuffers(kUdpClient client, kSSize socketSize, kSSize clientSize)
Sets the size of write buffers.
Represents a network socket.
Represents a boolean value.