tests/udstest.cc File Reference

This file contains a two-part test for UNIX domain sockets. More...

#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <sstream>
#include "consmgr.h"
#include "sockconn.h"
#include "udslistener.h"
#include "udssockaddr.h"

Include dependency graph for udstest.cc:

Go to the source code of this file.

Functions

static int uds_test ()
static void accept_and_send_on_connection (Listener *listener, SocketAddressP &path)
static void * socket_sender_thread (void *path)
 Probably senseless wrapper.
static void socket_sender (SocketAddressP &path)
 Connect to a Unix-domain socket, send some data on it, and close it.
int main (int argc, char *argv[])


Detailed Description

This file contains a two-part test for UNIX domain sockets.

It constructs a Listener on a [randomly named] temporary UDS, then starts a thread to connect (via construction of a Connector) to said UDS, and invokes the listen_for_incoming() method of Listener. The code that constructs the Connector will then manually build data and write it over said Connector.

Note:
The description of what this test does is poorly written.

Definition in file udstest.cc.


Function Documentation

static int uds_test (  )  [static]

Definition at line 83 of file udstest.cc.

References accept_and_send_on_connection(), and Listener::disconnect().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void accept_and_send_on_connection ( Listener listener,
SocketAddressP path 
) [static]

Definition at line 112 of file udstest.cc.

References Listener::get_id(), Listener::listen_for_incoming(), PTHREAD_CHECK_AND_THROW, and socket_sender_thread().

Here is the call graph for this function:

void * socket_sender_thread ( void *  path  )  [static]

Probably senseless wrapper.

But it seems nice to have a general-purpose UDS connect-and-send method, not tied to any threadiness.

Definition at line 143 of file udstest.cc.

References socket_sender().

Here is the call graph for this function:

void socket_sender ( SocketAddressP path  )  [static]

Connect to a Unix-domain socket, send some data on it, and close it.

I should probably ammend this some time to take the data to write as a MessageP, or Data*, or std::string, or something.

Definition at line 154 of file udstest.cc.

References Connector::write().

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 72 of file udstest.cc.

References uds_test().

Here is the call graph for this function:


Generated on Tue May 13 11:32:42 2008 for consmgr by  doxygen 1.5.5