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
92OBSOLETE(Resolving remote hosts is disabled; use PSC_Resolver instead)
94 CMETHOD;
95
109DECLEXPORT void
111 CMETHOD;
112
117DECLEXPORT void
119
126DECLEXPORT PSC_UnixClientOpts *
127PSC_UnixClientOpts_create(const char *sockname)
128 ATTR_RETNONNULL ATTR_NONNULL((1));
129
137DECLEXPORT void
139 CMETHOD;
140
145DECLEXPORT void
147
156DECLEXPORT PSC_Connection *
158 ATTR_NONNULL((1));
159
176DECLEXPORT int
178 void *receiver, PSC_ClientCreatedHandler callback)
179 ATTR_NONNULL((1)) ATTR_NONNULL((3));
180
189DECLEXPORT PSC_Connection *
190PSC_Connection_createUnixClient(const PSC_UnixClientOpts *opts)
191 ATTR_NONNULL((1));
192
193#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.
A resolver to do a batch of reverse DNS lookups.
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