1#ifndef POSER_CORE_CONNECTION_H
2#define POSER_CORE_CONNECTION_H
45typedef const char *(*PSC_MessageEndLocator)(
const char *str);
57 CMETHOD ATTR_RETNONNULL ATTR_PURE;
73 CMETHOD ATTR_RETNONNULL ATTR_PURE;
89 CMETHOD ATTR_RETNONNULL ATTR_PURE;
101 CMETHOD ATTR_RETNONNULL ATTR_PURE;
112OBSOLETE(Resolving remote hosts is disabled; use
PSC_Resolver instead)
114 CMETHOD ATTR_RETNONNULL ATTR_PURE;
133DECLEXPORT
const char *
135 CMETHOD ATTR_RETNONNULL ATTR_PURE;
144DECLEXPORT
const char *
191 CMETHOD ATTR_NONNULL((2));
234 const uint8_t *buf,
size_t sz,
void *
id)
235 CMETHOD ATTR_NONNULL((2));
251 CMETHOD ATTR_NONNULL((2));
321 void *data,
void (*deleter)(
void *))
341DECLEXPORT
const uint8_t *
363DECLEXPORT
const char *
void * PSC_Connection_data(const PSC_Connection *self)
Retreive attached data object.
void PSC_Connection_pause(PSC_Connection *self)
Pause receiving data.
void PSC_Connection_receiveLine(PSC_Connection *self)
Configure for receiving lines.
void PSC_Connection_close(PSC_Connection *self, int blacklist)
Close connection.
const char * PSC_Connection_remoteAddr(const PSC_Connection *self)
The remote address.
const PSC_IpAddr * PSC_Connection_remoteIpAddr(const PSC_Connection *self)
The remote IP address.
void PSC_Connection_receiveText(PSC_Connection *self, PSC_MessageEndLocator locator)
Configure for receiving text.
PSC_Event * PSC_Connection_closed(PSC_Connection *self)
Connection closed.
int PSC_Connection_remotePort(const PSC_Connection *self)
The remote port.
PSC_Event * PSC_Connection_dataReceived(PSC_Connection *self)
Data received.
void PSC_Connection_setData(PSC_Connection *self, void *data, void(*deleter)(void *))
Attach a data object.
int PSC_Connection_resume(PSC_Connection *self)
Resume receiving data.
int PSC_Connection_confirmDataReceived(PSC_Connection *self)
Confirm receiving data is completed.
PSC_Event * PSC_Connection_connected(PSC_Connection *self)
Connection successfully connected.
PSC_Event * PSC_Connection_nameResolved(PSC_Connection *self)
Remote name resolved.
int PSC_Connection_receiveBinary(PSC_Connection *self, size_t expected)
Configure for receiving binary data.
int PSC_Connection_sendAsync(PSC_Connection *self, const uint8_t *buf, size_t sz, void *id)
Send data to the peer.
int PSC_Connection_sendTextAsync(PSC_Connection *self, const char *text, void *id)
Send text to the peer.
const char * PSC_Connection_remoteHost(const PSC_Connection *self)
The remote hostname.
PSC_Event * PSC_Connection_dataSent(PSC_Connection *self)
Data sent.
Event arguments for data received on a connection.
size_t PSC_EADataReceived_size(const PSC_EADataReceived *self)
The size of the data received.
const uint8_t * PSC_EADataReceived_buf(const PSC_EADataReceived *self)
The data received.
const char * PSC_EADataReceived_text(const PSC_EADataReceived *self)
The text received.
void PSC_EADataReceived_markHandling(PSC_EADataReceived *self)
Mark received data as being handled.
An IPv4 or IPv6 address or network.
A resolver to do a batch of reverse DNS lookups.
const char *(* PSC_MessageEndLocator)(const char *str)
Callback to find the end of a text message.
Definition: connection.h:45