fnet.c

Simple C networking library
git clone git://git.finwo.net/lib/fnet.c
Log | Files | Refs | README

commit f0decbca8063719926a027beacce8af62babb4af
parent 566a1eedad91d16d8dc99dcbbaba088541d73eef
Author: Yersa Nordman <yersa@finwo.nl>
Date:   Mon,  7 Aug 2023 23:21:21 +0200

Call onConnect after connecting using fnet_connect function

Diffstat:
Msrc/fnet.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/fnet.c b/src/fnet.c @@ -378,6 +378,16 @@ struct fnet_t * fnet_connect(const char *address, uint16_t port, const struct fn } conn->ext.status = FNET_STATUS_CONNECTED; + + if (conn->ext.onConnect) { + conn->ext.onConnect(&((struct fnet_ev){ + .connection = (struct fnet_t *)conn, + .type = FNET_EVENT_CONNECT, + .buffer = NULL, + .udata = conn->ext.udata, + })); + } + return (struct fnet_t *)conn; }