MOS Source Code
Loading...
Searching...
No Matches
ipc_io.cpp File Reference
#include "mos/ipc/ipc_io.hpp"
#include "mos/io/io.hpp"
#include "mos/ipc/ipc.hpp"
#include "mos/misc/panic.hpp"
#include <mos/allocator.hpp>
#include <mos_stdlib.hpp>
Include dependency graph for ipc_io.cpp:

Go to the source code of this file.

Classes

struct  IPC_ControlIO
struct  ipc_server_io_t
struct  IpcServerIO
struct  IpcClientIO

Functions

PtrResult< IpcConnectionIOipc_conn_io_create (IpcDescriptor *desc, bool isServerSide)
 Create a new IPC connection io descriptor.
PtrResult< IOipc_create (const char *name, size_t max_pending_connections)
 Create a new IPC server.
PtrResult< IOipc_accept (IO *server)
 Accept a new connection on an IPC server.
PtrResult< IOipc_connect (const char *name, size_t buffer_size)
 Connect to an IPC servers.

Function Documentation

◆ ipc_conn_io_create()

PtrResult< IpcConnectionIO > ipc_conn_io_create ( IpcDescriptor * ipc,
bool is_server_side )

Create a new IPC connection io descriptor.

Parameters
ipcThe IPC object to create the connection for
is_server_sideWhether this is the server side of the connection
Returns
ipc_conn_io_t* A new IPC connection io descriptor

Definition at line 74 of file ipc_io.cpp.

Referenced by ipc_accept(), ipc_connect(), and vfs_ipc_file_read().

Here is the call graph for this function:

◆ ipc_create()

PtrResult< IO > ipc_create ( const char * name,
size_t max_pending_connections )

Create a new IPC server.

Parameters
nameThe name of the server
max_pending_connectionsThe maximum number of pending connections to allow
Returns
A new IO object that represents the server, or an error code on failure
Note
The IO returned by this function is only to accept new connections or close the server, reading or writing to it will fail.

Definition at line 92 of file ipc_io.cpp.

◆ ipc_accept()

PtrResult< IO > ipc_accept ( IO * server)

Accept a new connection on an IPC server.

Parameters
serverThe server to accept a connection on
Returns
An IO for the server side of the connection, or an error code on failure

Definition at line 109 of file ipc_io.cpp.

Referenced by ipc_accept().

Here is the call graph for this function:

◆ ipc_connect()

PtrResult< IO > ipc_connect ( const char * name,
size_t buffer_size )

Connect to an IPC servers.

Parameters
nameThe name of the server to connect to
buffer_sizeThe size of a shared-memory buffer to use for the connection
Returns
A new IO object that represents the connection, or an error code on failure

Definition at line 126 of file ipc_io.cpp.