Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kTcpClient.h
Go to the documentation of this file.
1
10 #ifndef K_API_TCP_CLIENT_H
11 #define K_API_TCP_CLIENT_H
12
13 #include <kApi/Io/kNetwork.h>
14
15 kBeginHeader()
16
17
24 //typedef kStream kTcpClient; --forward-declared in kApiDef.x.h
25
26
35 kFx(kStatus) kTcpClient_Construct(kTcpClient* client, kIpVersion ipVersion, kAlloc allocator);
36
53 kFx(kStatus) kTcpClient_SetWriteBuffers(kTcpClient client, kSSize socketSize, kSSize clientSize);
54
68 kFx(kStatus) kTcpClient_SetReadBuffers(kTcpClient client, kSSize socketSize, kSSize clientSize);
69
80 kFx(kStatus) kTcpClient_SetWriteTimeout(kTcpClient client, k64u timeout);
81
92 kFx(kStatus) kTcpClient_SetReadTimeout(kTcpClient client, k64u timeout);
93
105 kFx(kStatus) kTcpClient_SetNoDelay(kTcpClient client, kBool noDelay);
106
136 kFx(kStatus) kTcpClient_EnableSeek(kTcpClient client, kBool enabled);
137
150 kFx(kStatus) kTcpClient_SetCancelHandler(kTcpClient client, kCallbackFx function, kPointer receiver);
151
163 kFx(kStatus) kTcpClient_Cancel(kTcpClient client);
164
177 kFx(kStatus) kTcpClient_Connect(kTcpClient client, kIpAddress address, k32u port, k64u timeout);
178
196 kFx(kStatus) kTcpClient_BeginConnect(kTcpClient client, kIpAddress address, k32u port);
197
207 kFx(kStatus) kTcpClient_EndConnect(kTcpClient client, k64u timeout);
208
220 kFx(kStatus) kTcpClient_Wait(kTcpClient client, k64u timeout);
221
229 kFx(kSocket) kTcpClient_Socket(kTcpClient client);
230
241 kFx(kSize) kTcpClient_Available(kTcpClient client);
242
251 kFx(kStatus) kTcpClient_LocalEndPoint(kTcpClient client, kIpEndPoint* endPoint);
252
261 kFx(kStatus) kTcpClient_RemoteEndPoint(kTcpClient client, kIpEndPoint* endPoint);
262
270 kFx(kStatus) kTcpClient_Status(kTcpClient client);
271
272 kEndHeader()
273
274 #include <kApi/Io/kTcpClient.x.h>
275
276 #endif
kTcpClient::kTcpClient_SetWriteBuffers
kStatus kTcpClient_SetWriteBuffers(kTcpClient client, kSSize socketSize, kSSize clientSize)
Sets the size of write buffers.
k32u
Represents a 32-bit unsigned integer.
k64u
Represents a 64-bit unsigned integer.
kIpVersion
Represents an Internet Protocol version.
kPointer
Represents a void pointer.
kTcpClient::kTcpClient_Connect
kStatus kTcpClient_Connect(kTcpClient client, kIpAddress address, k32u port, k64u timeout)
Connects to a remote end point.
kTcpClient::kTcpClient_Status
kStatus kTcpClient_Status(kTcpClient client)
Reports any internal errors that will prevent success of future communication attempts.
kTcpClient::kTcpClient_LocalEndPoint
kStatus kTcpClient_LocalEndPoint(kTcpClient client, kIpEndPoint *endPoint)
Returns the local end point for a connected client.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kTcpClient::kTcpClient_Construct
kStatus kTcpClient_Construct(kTcpClient *client, kIpVersion ipVersion, kAlloc allocator)
Constructs a TCP client object.
kIpAddress
Represents an IP address.
Definition: kNetwork.h:38
kSSize
Represents a signed integer that can store a pointer address.
kTcpClient::kTcpClient_BeginConnect
kStatus kTcpClient_BeginConnect(kTcpClient client, kIpAddress address, k32u port)
Begins connecting to a remote end point.
kTcpClient::kTcpClient_SetCancelHandler
kStatus kTcpClient_SetCancelHandler(kTcpClient client, kCallbackFx function, kPointer receiver)
Sets a cancel query handler, which can be used to asynchronously terminate read/write operations...
kTcpClient
Represents a TCP client.
kTcpClient::kTcpClient_Wait
kStatus kTcpClient_Wait(kTcpClient client, k64u timeout)
Waits until the client has bytes to read or until the specified timeout period elapses.
kTcpClient::kTcpClient_Available
kSize kTcpClient_Available(kTcpClient client)
Returns the number of bytes currently enqueued and available for reading.
kCallbackFx
kStatus(kCall * kCallbackFx)(kPointer receiver, kPointer sender, void *args)
Callback signature for a generic event handler.
Definition: kApiDef.h:1508
kTcpClient::kTcpClient_EndConnect
kStatus kTcpClient_EndConnect(kTcpClient client, k64u timeout)
Completes a connection operation that was started with kTcpClient_BeginConnect.
kTcpClient::kTcpClient_SetReadBuffers
kStatus kTcpClient_SetReadBuffers(kTcpClient client, kSSize socketSize, kSSize clientSize)
Sets the size of read buffers.
kTcpClient::kTcpClient_RemoteEndPoint
kStatus kTcpClient_RemoteEndPoint(kTcpClient client, kIpEndPoint *endPoint)
Returns the remote end point for a connected client.
kNetwork.h
IP networking definitions.
kStatus
Represents an error code.
kIpEndPoint
Represents an IP end point (address, port).
Definition: kNetwork.h:170
kTcpClient::kTcpClient_Cancel
kStatus kTcpClient_Cancel(kTcpClient client)
Cancels any pending I/O operations.
kTcpClient::kTcpClient_EnableSeek
kStatus kTcpClient_EnableSeek(kTcpClient client, kBool enabled)
Enables limited support for forward/reverse seek operations.
kTcpClient::kTcpClient_Socket
kSocket kTcpClient_Socket(kTcpClient client)
Returns the underlying kSocket object.
kTcpClient::kTcpClient_SetWriteTimeout
kStatus kTcpClient_SetWriteTimeout(kTcpClient client, k64u timeout)
Sets the timeout duration for write operations.
kTcpClient::kTcpClient_SetNoDelay
kStatus kTcpClient_SetNoDelay(kTcpClient client, kBool noDelay)
Can be used to disable the Nagle algorithm.
kSocket
Represents a network socket.
kBool
Represents a boolean value.
kTcpClient::kTcpClient_SetReadTimeout
kStatus kTcpClient_SetReadTimeout(kTcpClient client, k64u timeout)
Sets the timeout duration for read operations.