#include "netlib.h"
#include "wavesock.h"
#include <deque>
#include <string.h>
#include "common/wave_ex.h"
#include "perf/perf.h"
#include "util/parsing.h"
Go to the source code of this file.
Namespaces | |
namespace | netlib |
Defines | |
#define | _XOPEN_SOURCE 600 |
Typedefs | |
typedef std::deque< request_t > | netlib::message_queue_t |
typedef std::map< conn_id_t, smart_ptr< conn_rec_t > > | netlib::conn_map_t |
Functions | |
static const char * | netlib::getTypeName (IN eConnectionType type) |
static conn_id_t | netlib::getNewConnectionId (void) |
static void | netlib::dumpErrorInfo (IN const char *msg) |
static void | netlib::verify (IN bool isOK, IN const char *msg) |
static void | netlib::verifyThrow (IN bool isOK, IN const char *msg) |
static conn_rec_t * | netlib::getConnectionRecord (IN conn_id_t conn_id) |
static bool | netlib::readBuffer (IN conn_rec_t *rec) |
static void | netlib::parseHeaderLine (IN conn_rec_t *rec) |
static bool | netlib::handleData (IN conn_rec_t *rec, IO envelope_t &envelope, IO smart_ptr< MessageBuffer > &msgbuf) |
static conn_id_t | netlib::addConnectionRecord (IN eConnectionType type, IN int socket, IN const address_t &address) |
static conn_id_t | netlib::handleConnection (IN conn_rec_t *rec) |
static void | netlib::writeMessage (IN conn_rec_t *rec) |
static void | netlib::handleWrites (IN ws_set_t writeable) |
static bool | netlib::handleRead (IN ws_set_t readers, IO envelope_t &envelope, IO smart_ptr< MessageBuffer > &msgbuf) |
std::string | netlib::getServerFromIP (IN const ip_addr_t &ip) |
conn_id_t | netlib::createTcpListener (IN const address_t &address, IN int maxBacklog) |
create a listener (if clients connect, you'll see their messages show up) | |
conn_id_t | netlib::createTcpConnection (IN const address_t &address) |
create a connection to a remote peer (connection ID is returned) | |
conn_id_t | netlib::createUdpLocal (IN const address_t &localUdp) |
create a local UDP connection for sending/receiving datagrams. | |
conn_id_t | netlib::createUdpRemote (IN conn_id_t localUdp, IN const address_t &address) |
create a logical connection to represent a remote UDP sender/receiver
| |
conn_id_t | netlib::createUdpBroadcast (IN const address_t &broadcastAddress) |
create a local UDP sending point for datagram broadcasts to a specific port. | |
bool | netlib::enqueueMessage (IN conn_id_t connId, IN smart_ptr< MessageBuffer > &message) |
asynchronously send data to a particular connection
| |
bool | netlib::getNextMessage (IN long wait_microseconds, OUT netlib::envelope_t &envelope, OUT smart_ptr< MessageBuffer > &buffer) |
get next message from all open connections (empty if no messages waiting)
| |
bool | netlib::isValidConnection (IN conn_id_t conn_id) |
is this a valid connection? | |
bool | netlib::getConnectionInfo (IN conn_id_t conn_id, OUT connection_info_t &info) |
given a connection, retrieve information about it | |
void | netlib::closeConnection (IN conn_id_t conn_id) |
terminate a particular connection | |
void | netlib::dumpMessage (IO std::ostream &stream, IN const char *title, IN const envelope_t &envelope, IN const MessageBuffer *buffer) |
for debugging | |
void | netlib::dumpStats (void) |
info only | |
Variables | |
static const int | netlib::s_chunkSize = 8192 |
static const int | netlib::s_maxHeaderLine = 64 |
static conn_map_t | netlib::s_connection_map |
static dword_t | netlib::s_messagesSent = 0 |
static dword_t | netlib::s_messagesReceived = 0 |
static qword_t | netlib::s_bytesWritten = 0 |
static qword_t | netlib::s_bytesRead = 0 |
#define _XOPEN_SOURCE 600 |
Definition at line 41 of file netlib.cpp.