summaryrefslogtreecommitdiff
path: root/cmd/srv9p/gnet.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-15 21:03:18 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-15 21:03:18 -0600
commit32caa64b67b6f6a4c3c8a0b270a8b12b2f05389b (patch)
treea833402307974ee7d874dcd768a46b9cde0f81f8 /cmd/srv9p/gnet.c
parent3dcbd43ecd77c28762b0595475893ff052c0444a (diff)
wip
Diffstat (limited to 'cmd/srv9p/gnet.c')
-rw-r--r--cmd/srv9p/gnet.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmd/srv9p/gnet.c b/cmd/srv9p/gnet.c
index 5072428..2bed355 100644
--- a/cmd/srv9p/gnet.c
+++ b/cmd/srv9p/gnet.c
@@ -69,7 +69,7 @@ static inline bool RUN_PTHREAD(void *(*fn)(void *), void *args) {
return false;
}
-/* vtables ********************************************************************/
+/* init() ( AKA socket(3) + listen(3) )****************************************/
static struct libnet_conn *gnet_accept(struct libnet_listener *_listener);
static ssize_t gnet_read(struct libnet_conn *conn, void *buf, size_t count);
@@ -86,8 +86,6 @@ static struct libnet_conn_vtable gnet_conn_vtable = {
.close = gnet_close,
};
-/* listen() *******************************************************************/
-
void gnet_listener_init(struct gnet_listener *self, uint16_t port) {
int listenerfd;
union {
@@ -175,7 +173,7 @@ static void *_pthread_read(void *_args) {
};
static ssize_t gnet_read(struct libnet_conn *_conn, void *buf, size_t count) {
- struct gnet_conn *conn = (struct gnet_conn *)_conn;
+ struct _gnet_conn *conn = (struct _gnet_conn *)_conn;
assert(conn);
ssize_t ret;
@@ -225,7 +223,7 @@ static void *_pthread_write(void *_args) {
};
static ssize_t gnet_write(struct libnet_conn *_conn, void *buf, size_t count) {
- struct gnet_conn *conn = (struct gnet_conn *)_conn;
+ struct _gnet_conn *conn = (struct _gnet_conn *)_conn;
assert(conn);
ssize_t ret;
@@ -247,7 +245,7 @@ static ssize_t gnet_write(struct libnet_conn *_conn, void *buf, size_t count) {
/* close() ********************************************************************/
static int gnet_close(struct libnet_conn *_conn, bool rd, bool wr) {
- struct gnet_conn *conn = (struct gnet_conn *)_conn;
+ struct _gnet_conn *conn = (struct _gnet_conn *)_conn;
assert(conn);
int how;