InterViews Reference Manual -- Connection

NAME
Connection - interprocess communication
SYNOPSIS
#include <InterViews/connection.h>
DESCRIPTION
Connection provides a simple interface to interprocess communication. A general connection can be made between processes on the same or different machines. A local connection can only be made between processes on the same machine.
PUBLIC OPERATIONS
Connection()
~Connection()
Construct a connection, initially not associated with any process.
Connection(int)
Construct a connection associated with the given Unix file descriptor.
void CreateService(const char* host, int port)
void CreateLocalService(const char*)
Create a connection and bind it to a particular address. In the general case, the address is defined by the host name and Internet port number. In the local case, a string name is used.
bool OpenService(const char* host, int port)
bool OpenLocalService(const char*)
Establish a connection with another process. It is assumed the process has already created the service. If no connection can be made, the open functions return false.
Connection* AcceptClient()
Create a new connection for communicating with a client. AcceptClient is called by servers that receive input on a general service connection.
int Pending()
Return the number of bytes waiting to be read from a connection.
int Read(void* buf, int n)
Read up to n bytes from the connection into buf Return the actual number of bytes read.
int Write(const void* buf, int n)
Write n bytes from buf to the connection. Return the actual number of bytes written.
int WritePad(const void* buf, int n, int pad)
Write pad bytes to the connection. The first n bytes are from buf, any remaining are zero. Return the actual number of bytes written.
int Descriptor()
Return the file descriptor associated with the connection.
void Close()
Close the connection. Subsequent operations, such as Read and Write, will return an error code of -1.

Next: Control | Prev: Color | Up: index | Top: index