ROAR_STREAM_CONNECT_TO(3)

πŸ“¦ version 1.0~beta12, in ubuntu jammy

πŸ’– roar_stream_connect_to(3) πŸ’–

okay bestie, so this one lives in the System Manager's Manual: RoarAudio section of the manual pages, and it's literally the function that makes your stream go out and grab data from somewhere else. no cap.


✨ NAME ✨

roar_stream_connect_to β€” Connects a stream to some listening socket 🫢


🌸 SYNOPSIS 🌸

#include <roariaudio.h>

wait no hold on hold on. it's:

#include <roaraudio.h>

int roar_stream_connect_to(struct roar_connection * con, struct
roar_stream * s, int type, char * host, int port);

ok slay, that's the one. copy that exactly bestie, don't let me catch you typo-ing the include. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So the way this works is: it lets the sound server connect out to some remote end to get its data for a stream. it's giving "hey server, go fetch". 🌈

This is used internally to open additional streams for roar_simple_new_stream(3), so like, that's its main character energy origin story.

⚠️ NOTE: This is not an alternative version of roar_stream_connect(3). Like, at all. You still need to connect the stream to the server via roar_stream_connect(3) before you can use this call. fr fr, do it in that order or nothing works. 😭

πŸŽ€ PARAMETERS πŸŽ€

  • con β€” the connection to the server. your little link to home base. πŸ’œ
  • s β€” the stream to connect. the one we're sending off into the world.
  • type, host, port β€” where the stream should be connected to. like, the destination, the address, the whole vibe. for a full description of all these parameters, go peek at roar_socket_listen(3). iykyk. ✨

πŸ’… NOTES πŸ’…

Okay so this part is important and i need you to actually read it:

This call will block until the server process it's connecting to has accepted the connection. Yes, block. It just sits there. patient. waiting. 🧘

And because of that, this call is unusable to connect back to us if we are not threaded. Like, it will deadlock you, bestie, it's giving trap. πŸ’€

For a nonblocking call, go see roar_stream_connect_to_ask(3) instead. that's the one you want in that situation, periodt.


⭐ RETURN VALUE ⭐

  • On success these calls return 0. πŸ₯³
  • On error, -1 is returned. 😭

that's it, that's the whole contract. no in-between.


πŸ™ˆ EXAMPLES πŸ™ˆ

FIXME

yeah bestie they literally just wrote FIXME. iconic honestly. the docs said "figure it out yourself". 😭✨


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie!! πŸ’– this one came from RoarAudio, dated May 2011, and it's filed under roar_str...nnect_to(3) in the manual. go forth and connect some streams, you absolute legend. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from