# Networking

To use any of these objects all you need to do is #include the file indicated in the short section about the component you would like to use. Pick which implementation you would like and typedef it to something nice. Here is an example of creating a typedef for a linker using the first kernel implementation.
typedef dlib::linker::kernel_1a linker1;

Objects
linker
server
bridge
sockstreambuf
linker
dlib/linker.h
dlib/linker/linker_kernel_abstract.h
This object represents something that takes two connections and lets them talk to each other. ie. any incoming data from one connection is passed unaltered to the other and vice versa.
linker_kernel_1
dlib/linker/linker_kernel_1.h
This implementation is done just using the objects defined in the sockets and threads packages.
kernel_1a
is a typedef for linker_kernel_1
bridge
dlib/bridge.h
dlib/bridge/bridge_abstract.h
This object is a tool for bridging a pipe object between two network connected applications.
bridge_ex.cpp.html
server
dlib/server.h
dlib/server/server_kernel_abstract.h
This object represents a server that listens on a port and spawns new threads to handle each new connection. It also manages the connections and threads for you.
sockets_ex.cpp.html
sockstreambuf_ex.cpp.html
server_http_ex.cpp.html
server_kernel_1
dlib/server/server_kernel_1.h
This implementation is done using the objects defined in the sockets and threads packages. It also uses a set to keep track of the connections.
kernel_1a
is a typedef for server_kernel_1 that uses set_kernel_1a
iostream
dlib/server/server_iostream_abstract.h
This extension redefines the on_connect() function so that instead of giving you a connection object you get an istream and ostream object.
server_iostream_1
dlib/server/server_iostream_1.h
This is implemented in the obvious way using the sockstreambuf object.
iostream_1a
is a typedef for server_kernel_1a extended by server_iostream_1 that uses sockstreambuf_kernel_2a
http
dlib/server/server_http_abstract.h
This extension turns the server object into a simple HTTP server.
server_http_ex.cpp.html
server_http_1
dlib/server/server_http_1.h
This is implemented in the obvious way.
http_1a
is a typedef for server_iostream_1a extended by server_http_1
sockstreambuf
dlib/sockstreambuf.h
dlib/sockstreambuf/sockstreambuf_kernel_abstract.h
This object represents a stream buffer for connection objects.
sockstreambuf_ex.cpp.html
sockets_ex_2.cpp.html
sockstreambuf_kernel_1
dlib/sockstreambuf/sockstreambuf_kernel_1.h
This implementation is done in the obvious way without any sort of buffering.
kernel_1a
is a typedef for sockstreambuf_kernel_1
sockstreambuf_kernel_2
dlib/sockstreambuf/sockstreambuf_kernel_2.h
This implementation is done in the obvious way but with buffering. Thus, it is considerably faster than the unbuffered version of this object.
kernel_2a
is a typedef for sockstreambuf_kernel_2