# Networking

This page documents tools built on top of the dlib sockets API. Therefore, all these tools are focused on providing some kind of higher level networking abstraction or service.

Objects
linker
server
server_iostream
server_http
bridge
sockstreambuf
BSP
bsp_connect
bsp_listen
bsp_listen_dynamic_port
bsp_context
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
bsp_connect
dlib/bsp.h
dlib/bsp/bsp_abstract.h
This function spawns a BSP job consisting of a number of network hosts as well as the local host.
bsp_ex.cpp.html
bsp_listen
dlib/bsp.h
dlib/bsp/bsp_abstract.h
This function listens for a TCP connection from the bsp_connect routine. Once this connection is established, a user supplied function will be executed and it will then be able to participate in a BSP computation as one of the processing nodes.
bsp_ex.cpp.html
bsp_listen_dynamic_port
dlib/bsp.h
dlib/bsp/bsp_abstract.h
This function listens for a TCP connection from the bsp_connect routine. Once this connection is established, a user supplied function will be executed and it will then be able to participate in a BSP computation as one of the processing nodes. This function has the additional ability to select the listening TCP port automatically from the set of available ports.
bsp_context
dlib/bsp.h
dlib/bsp/bsp_abstract.h
This is a tool used to implement algorithms using the Bulk Synchronous Parallel (BSP) computing model. In particular, this object defines the API used for communication between BSP jobs.
bsp_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_iostream
dlib/server.h
dlib/server/server_iostream_abstract.h
This is an extension of the server object that redefines the on_connect() function so that instead of giving you a connection object you get an istream and ostream object.
server_http
dlib/server.h
dlib/server/server_http_abstract.h
This is an extension of the server_iostream object which turns it into a simple HTTP server.
server_http_ex.cpp.html
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