UDT Tutorial |
In this section we will introduce the simplest UDT program that can transfer data in high performance.
This simple "Hello World!" example includes a server program and a client program just like any socket programming tutorial. These are the simpler version of the appserver and appclient examples in ./app directory.
To compile, use gcc -o server server.cpp -I<udt.h location> -L<libudt.so location> -ludt -lstdc++ -lpthread. For more details, please refer to the Makefile in ./app directory.
UDT server example
#include <iostream> |
This simple server tries to bind itself at port 9000. If succeed, it listens at port 9000 and accepts a client and then reads a string.
UDT client example
#include <iostream> |
The client side connects to the local address (127.0.0.1) at port 9000, and sends a "hello world!" message.