1#ifndef POSER_CORE_CONNECTION_H
2#define POSER_CORE_CONNECTION_H
44typedef const char *(*PSC_MessageEndLocator)(
const char *str);
56 CMETHOD ATTR_RETNONNULL ATTR_PURE;
72 CMETHOD ATTR_RETNONNULL ATTR_PURE;
88 CMETHOD ATTR_RETNONNULL ATTR_PURE;
100 CMETHOD ATTR_RETNONNULL ATTR_PURE;
110 CMETHOD ATTR_RETNONNULL ATTR_PURE;
119DECLEXPORT
const char *
121 CMETHOD ATTR_RETNONNULL ATTR_PURE;
130DECLEXPORT
const char *
177 CMETHOD ATTR_NONNULL((2));
220 const uint8_t *buf,
size_t sz,
void *
id)
221 CMETHOD ATTR_NONNULL((2));
237 CMETHOD ATTR_NONNULL((2));
307 void *data,
void (*deleter)(
void *))
327DECLEXPORT
const uint8_t *
349DECLEXPORT
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.
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.
const char *(* PSC_MessageEndLocator)(const char *str)
Callback to find the end of a text message.
Definition: connection.h:44