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

# roar\_socket\_nonblock(3)

Sets blocking state of a socket

## NAME

roar\_socket\_nonblock - Sets blocking state of a socket

## SYNOPSIS

\#include \<roaraudio.h\>

int roar\_socket\_nonblock(int fh, int state);

## DESCRIPTION

Sets the blocking mode of a given filehandle. For information on nonblocking IO see [**open**(2)](/open/2.md) an look for **O\_NONBLOCK**.

## PARAMETERS

- **fh**

  The filehandle to set the new state on.

- **state**

  The new state. This may be **ROAR\_SOCKET\_BLOCK** to sett blocking or **ROAR\_SOCKET\_NONBLOCK** to set nonblocking mode. **ROAR\_SOCKET\_NONBLOCK** is the same as setting **O\_NONBLOCK** within [**open**(2)](/open/2.md).

## RETURN VALUE

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

## EXAMPLES

FIXME

## SEE ALSO

[**open**(2)](/open/2.md), [**libroar**(7)](/libroar/7.md), [**RoarAudio**(7)](/RoarAudio/7.md).
