networking · beginner · ~15 min
Recognise the stream socket type constant.
Implement int is_stream_socket(int type) returning 1 if type is SOCK_STREAM (TCP), else 0.
#include <sys/socket.h>
int is_stream_socket(int type) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.