#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"
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[]) |
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.
Definition in file udstest.cc.
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().
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().
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().
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().
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Definition at line 72 of file udstest.cc.
References uds_test().