poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1#ifndef POSER_CORE_CLIENT_H
2#define POSER_CORE_CLIENT_H
3
8#include <poser/decl.h>
9
10#include <poser/core/proto.h>
11#include <stddef.h>
12
13C_CLASS_DECL(PSC_Connection);
14
18C_CLASS_DECL(PSC_TcpClientOpts);
19
23C_CLASS_DECL(PSC_UnixClientOpts);
24
33 void *receiver, PSC_Connection *connection);
34
42DECLEXPORT PSC_TcpClientOpts *
43PSC_TcpClientOpts_create(const char *remotehost, int port)
44 ATTR_RETNONNULL ATTR_NONNULL((1));
45
53DECLEXPORT void
55 CMETHOD;
56
65DECLEXPORT void
67 const char *certfile, const char *keyfile)
68 CMETHOD;
69
74DECLEXPORT void
76 CMETHOD;
77
83DECLEXPORT void
85 CMETHOD;
86
91DECLEXPORT void
93 CMETHOD;
94
108DECLEXPORT void
110 CMETHOD;
111
116DECLEXPORT void
118
125DECLEXPORT PSC_UnixClientOpts *
126PSC_UnixClientOpts_create(const char *sockname)
127 ATTR_RETNONNULL ATTR_NONNULL((1));
128
136DECLEXPORT void
138 CMETHOD;
139
144DECLEXPORT void
146
155DECLEXPORT PSC_Connection *
157 ATTR_NONNULL((1));
158
175DECLEXPORT int
177 void *receiver, PSC_ClientCreatedHandler callback)
178 ATTR_NONNULL((1)) ATTR_NONNULL((3));
179
188DECLEXPORT PSC_Connection *
189PSC_Connection_createUnixClient(const PSC_UnixClientOpts *opts)
190 ATTR_NONNULL((1));
191
192#endif
A socket connection.
PSC_Connection * PSC_Connection_createTcpClient(const PSC_TcpClientOpts *opts)
Create a connection as a TCP client.
int PSC_Connection_createTcpClientAsync(const PSC_TcpClientOpts *opts, void *receiver, PSC_ClientCreatedHandler callback)
Create a connection as a TCP client asynchronously.
Options for creating a TCP client.
void PSC_TcpClientOpts_setBlacklistHits(PSC_TcpClientOpts *self, int blacklistHits)
Enable blacklisting of failed remote addresses.
void PSC_TcpClientOpts_setProto(PSC_TcpClientOpts *self, PSC_Proto proto)
Set a specific protocol (IPv4 or IPv6).
void PSC_TcpClientOpts_numericHosts(PSC_TcpClientOpts *self)
Only use numeric hosts, don't attempt to resolve addresses.
void PSC_TcpClientOpts_destroy(PSC_TcpClientOpts *self)
PSC_TcpClientOpts destructor.
void PSC_TcpClientOpts_disableCertVerify(PSC_TcpClientOpts *self)
Disable server certificate verification.
void PSC_TcpClientOpts_readBufSize(PSC_TcpClientOpts *self, size_t sz)
Set read buffer size.
PSC_TcpClientOpts * PSC_TcpClientOpts_create(const char *remotehost, int port)
PSC_TcpClientOpts constructor.
void PSC_TcpClientOpts_enableTls(PSC_TcpClientOpts *self, const char *certfile, const char *keyfile)
Enable TLS for the connection.
Options for creating a UNIX socket client.
void PSC_UnixClientOpts_destroy(PSC_UnixClientOpts *self)
PSC_UnixClientOpts destructor.
void PSC_UnixClientOpts_readBufSize(PSC_UnixClientOpts *self, size_t sz)
Set read buffer size.
PSC_UnixClientOpts * PSC_UnixClientOpts_create(const char *sockname)
PSC_UnixClientOpts constructor.
void(* PSC_ClientCreatedHandler)(void *receiver, PSC_Connection *connection)
Handler for completed async client creation.
Definition: client.h:32
declaration of the PSC_Proto enum
PSC_Proto
Protocol to use for TCP connections.
Definition: proto.h:10