mirror of
https://github.com/CPunch/Laika.git
synced 2025-09-27 20:30:12 +00:00
Added new sLaika_peer member, 'uData'
- pktHandler was updated to pass 'uData'
This commit is contained in:
@@ -9,14 +9,15 @@
|
||||
struct sLaika_peer {
|
||||
struct sLaika_socket sock; /* DO NOT MOVE THIS. this member HAS TO BE FIRST so that typecasting sLaika_peer* to sLaika_sock* works as intended */
|
||||
struct sLaika_pollList *pList; /* pollList we're active in */
|
||||
void (*pktHandler)(struct sLaika_peer *peer, LAIKAPKT_ID id);
|
||||
void (*pktHandler)(struct sLaika_peer *peer, LAIKAPKT_ID id, void *uData);
|
||||
void *uData; /* data to be passed to pktHandler */
|
||||
size_t *pktSizeTable; /* const table to pull pkt size data from */
|
||||
size_t pktSize; /* current pkt size */
|
||||
LAIKAPKT_ID pktID; /* current pkt ID */
|
||||
size_t *pktSizeTable; /* const table to pull pkt size data from */
|
||||
bool setPollOut; /* is EPOLLOUT/POLLOUT is set on sock's pollfd ? */
|
||||
};
|
||||
|
||||
struct sLaika_peer *laikaS_newPeer(void (*pktHandler)(struct sLaika_peer *peer, LAIKAPKT_ID id), size_t *pktSizeTable, struct sLaika_pollList *pList);
|
||||
struct sLaika_peer *laikaS_newPeer(void (*pktHandler)(struct sLaika_peer *peer, LAIKAPKT_ID id, void *uData), size_t *pktSizeTable, struct sLaika_pollList *pList, void *uData);
|
||||
void laikaS_freePeer(struct sLaika_peer *peer);
|
||||
|
||||
bool laikaS_handlePeerIn(struct sLaika_peer *peer);
|
||||
|
Reference in New Issue
Block a user