Skip to content

File listener.h

FileList > docs > sandwich_c > listener.h

Go to the source code of this file

Sandwich C library, on top of the Rust implementation.

  • #include <sys/types.h>
  • #include "sandwich_c/export.h"
  • #include "sandwich_c/io.h"

Public Functions

Type Name
SANDWICH_API enum SandwichIOError sandwich_listener_accept (struct SandwichListener * listener, struct SandwichIOOwned ** ownedIO)
Prompts the Listener to start accepting connections.
SANDWICH_API void sandwich_listener_close (struct SandwichListener * listener)
Closes the listener to new connections.
SANDWICH_API void sandwich_listener_free (struct SandwichListener * listener)
Frees the given listener.
SANDWICH_API enum SandwichIOError sandwich_listener_listen (struct SandwichListener * listener)
Causes the Listener to start listening for connections.
SANDWICH_API struct SandwichError * sandwich_listener_new (const void * src, size_t n, struct SandwichListener ** out)
Creates a a new Listener object.

Public Functions Documentation

function sandwich_listener_accept

Prompts the Listener to start accepting connections.

SANDWICH_API enum SandwichIOError sandwich_listener_accept (
    struct SandwichListener * listener,
    struct SandwichIOOwned ** ownedIO
) 

Parameters:

  • listener the listener which should start accepting connections.
  • ownedIO the newly created OwnedIO struct containing the IO object to use with a tunnel. Null if an error occurs.

Returns:

IOERROR_OK if the operation was a success, otherwise returns the error that occurred.

function sandwich_listener_close

Closes the listener to new connections.

SANDWICH_API void sandwich_listener_close (
    struct SandwichListener * listener
) 

Parameters:

  • listener the listener which should close.

function sandwich_listener_free

Frees the given listener.

SANDWICH_API void sandwich_listener_free (
    struct SandwichListener * listener
) 

Parameters:

  • listener the listener which should start accepting connections.

function sandwich_listener_listen

Causes the Listener to start listening for connections.

SANDWICH_API enum SandwichIOError sandwich_listener_listen (
    struct SandwichListener * listener
) 

Parameters:

  • listener The listener object that should start listening for new connections.

Returns:

IOERROR_OK if the operation was a success, otherwise returns the error that occurred.

function sandwich_listener_new

Creates a a new Listener object.

SANDWICH_API struct SandwichError * sandwich_listener_new (
    const void * src,
    size_t n,
    struct SandwichListener ** out
) 

Parameters:

  • src a serialized ListenerConfiguration protobuf message.
  • n the length of src.
  • out points to the newly created listener.

Returns:

Error, if any.


The documentation for this class was generated from the following file docs/sandwich_c/listener.h