---
name: "roar_stream_connect_to"
section: "3"
platform: "linux"
package: "libroar-dev"
version: "1.0~beta12-4"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/roar_stream_connect_to"
---

# roar\_stream\_connect\_to(3)

Connects a stream to some listening socket

## NAME

roar\_stream\_connect\_to - Connects a stream to some listening socket

## SYNOPSIS

\#include \<roaraudio.h\>

int roar\_stream\_connect\_to(struct roar\_connection \* con, struct roar\_stream \* s, int type, char \* host, int port);

## DESCRIPTION

This let the sound server connect to some remote end to get it's data for a stream. This is used internaly to open additional streams for [**roar\_simple\_new\_stream**(3)](/roar_simple_new_stream/3.md).

**NOTE:** This is not an alternative version of [**roar\_stream\_connect**(3)](/roar_stream_connect/3.md). You still need to connect the stream to the server via [**roar\_stream\_connect**(3)](/roar_stream_connect/3.md) before you can use this call.

## PARAMETERS

- **con**

  The connection to the server.

- **s**

  The stream to connect.

- **type**, **host**, **port**

  Where the stream should be connected to. For a description of all these parameters see [**roar\_socket\_listen**(3)](/roar_socket_listen/3.md).

## NOTES

This call will block until the server process to connect to has accepted the connection. This makes this call unusable to connect back to us if we are not threaded. For a nonblocking call see **roar\_stream\_connect\_to\_ask**(3).

## RETURN VALUE

On success these calls return 0.  On error, -1 is returned.

## EXAMPLES

FIXME

## SEE ALSO

[**roar\_simple\_new\_stream**(3)](/roar_simple_new_stream/3.md), [**roar\_stream\_connect**(3)](/roar_stream_connect/3.md), [**roar\_socket\_listen**(3)](/roar_socket_listen/3.md), [**libroar**(7)](/libroar/7.md), [**RoarAudio**(7)](/RoarAudio/7.md).
