1. async - an Introduction
Async is an Asynchronous Socket Library (C++) providing event-driven socket programming
for Linux (or any other Os you get it to compile on).
The event callbacks (overridden virtual methods) are called from a loop (similar
gtk_main()), that uses
select() to check for socket events.
If you do not like event-driven programming, that's fine, you can use async as an ordinary
socket library too, and by calling
socket->SetNonBlock(false), all I/O functions
block as usual.
1.1 The async Class Structure
Connection - Base class for all others. Contains the basic socket ops:
Read(buf, len) and
SocketConnection - Base class for all socket-based Connections. For now, there are not any non socket-based Connections.
Extends Connection with SetNonBlock(bool), event notifications and some convenience functions for subclasses.
Don't use this class directly, use one of its subclasses below
StreamConnection - TCP socket class. Provides both server socket and client socket functions
Provides interfaces for binding, listening and accepting connections on a server socket. Most client socket functions are actually implemented in SocketConnection
DatagramConnection - UDP socket class. Provides Bind() to specify listening port and Connect() to specify default recipient for Write()
1.2 How do I get started?
1. Download sources (Click Download for a release, CVS if you want to live on the edge)
2. Unpack and run "make" (GNU make is the only tested, but please report your degree of success with other makes)
Now you have a library libasync.a and a bunch of include files in your source folder.
Move them to a good location, or keep them there and use -L<src-dir> and -I<src-dir>
(assuming you use gcc).
Read the headers to see what methods you have available etc. If you have any questions, consult the source or mail me at email@example.com.
An example showing a basic TCP server is in async_test_server.cpp
1.3 Who made this nifty piece of library?
Simon Brenner: firstname.lastname@example.org