roar_socket_listen(3)
π roar_socket_listen β bestie's guide to opening a listen socket π
okay so this is a page from the System Manager's Manual: RoarAudio section 3, and it's literally just roar_socket_listen(3). sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
roar_socket_listen β opens a new listen socket. that's it, that's the whole vibe. it's giving "come through, clients" π
πΈ SYNOPSIS πΈ
#include <roaraudio.h>
int roar_socket_listen(int type, char * host, int port);
look at her. three little args. main character energy fr fr. π
π¦ DESCRIPTION π¦
so like, this function opens a brand new listening socket β the kind that network clients can connect to. think of it as rolling out the pink carpet and waiting for the girlies to arrive. π«Ά
once it's open, you can accept new connections via accept(2). yes, that accept(2). go look it up, iykyk.
π PARAMETERS π
typeβ the type of the Socket. there's a whole list of them down below, keep reading bestie πhostβ the host or path name to listen on. and no, it's not always a hostname β it depends on thetypeargument. for TCP/IP, if you wanna listen on any interface, you pass a value of"0.0.0.0". that's the "i'm open to everyone" address, no cap.portβ the port number to listen on. some types don't do port numbers at all, so this one may just get ignored by them. not her fault, she's just built different. π
π₯ SOCKET TYPES π₯
ROAR_SOCKET_TYPE_UNKNOWN
the type gets auto detected. do not use this if you already know the type, bestie, i'm serious. only use it when you're handling user-given addresses and you actually need that auto detection magic. β¨
ROAR_SOCKET_TYPE_TCP
use a TCP/IP connection. this is the standard mode for networking, the moment, the icon. host is the hostname or IP to listen on, and port is the port number to use. π
ROAR_SOCKET_TYPE_INET
same as the one above but deprecated. like, it's giving vintage but not in a cute way. use ROAR_SOCKET_TYPE_TCP instead, periodt.
ROAR_SOCKET_TYPE_UNIX
UNIX Domain Socket. this one should be the default for local connections. host is the filename of the socket. very local, very cozy, very demure. πΈ
ROAR_SOCKET_TYPE_DECNET
DECnet socket. that's the whole description. she's mysterious like that. π
ROAR_SOCKET_TYPE_FORK
this is to fork a roard to communicate with. can't be used to listen on, only to connect to. host and port are ignored at the moment. so like, read the room, don't try to listen with this one. π
ROAR_SOCKET_TYPE_FILE
this is used to open a plain file. can't be used to listen on, just to connect to. host is the filename to connect to. again: not a listening type. don't do it. π«
π RETURN VALUE π
- on success, these calls return a filehandle. slay. π
- on error,
-1is returned. sad girl hours. π
π BUGS π
listening on UDP sockets is not supported at the moment. so if that was your plan... no it wasn't. π
π EXAMPLES π
FIXME
(no literally, that's what it says. the examples section is a FIXME. we're all just waiting. it's fine. it's fine. π§)
β SEE ALSO β
okay that's the whole page, bestie, you ate that. this was the RoarAudio manual page for roar_socket_listen(3), dated May 2011 β yes, may 2011, she's an elder but she still serves π
. mwah, go forth and listen responsibly π«Άπβ¨
π¦ where this page comes from
- ubuntu jammy: libroar-dev 1.0~beta12-4 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms