Networking in openFrameworks
openFrameworks' networking capabilities are implemented in two core addons: ofxNetwork
and ofxOsc
.
Tip
To use an addon in your project, you need to include it in the new project when creating a project using Project Generator (see Chapter 2, Creating Your First openFrameworks Project), or by including the addon's headers and libraries into the existing project manually. If you need to use only one particular addon, you can use an existing addon's example as a sketch for your project.
We have already included the ofxOsc
addon in our VideoSynth
project while creating it in Chapter 2, Creating Your First openFrameworks Project.
The ofxNetwork addon
The
ofxNetwork
addon contains classes for sending and receiving data using the
Transmission Control Protocol (TCP) and the
User Datagram Protocol (UDP). The difference between these protocols is that TCP guarantees receiving data without losses and errors but requires the establishment of a preliminary connection...