networking · beginner · ~15 min

Reliable transport?

Map socket type to reliability.

Challenge

Implement int is_reliable(int socktype) returning 1 for SOCK_STREAM (TCP, reliable ordered delivery), else 0.

Starter code

#include <sys/socket.h>

int is_reliable(int socktype) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.