Mercurial > hg > nodescore
comparison oscpack/examples/SimpleSend.cpp @ 76:0ae87af84e2f
added oscgroups
author | Rob Canning <rob@foo.net> |
---|---|
date | Sun, 13 Jul 2014 10:07:41 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
75:3a2845e3156e | 76:0ae87af84e2f |
---|---|
1 /* | |
2 Simple example of sending an OSC message using oscpack. | |
3 */ | |
4 | |
5 #include "osc/OscOutboundPacketStream.h" | |
6 #include "ip/UdpSocket.h" | |
7 | |
8 | |
9 #define ADDRESS "127.0.0.1" | |
10 #define PORT 7000 | |
11 | |
12 #define OUTPUT_BUFFER_SIZE 1024 | |
13 | |
14 int main(int argc, char* argv[]) | |
15 { | |
16 (void) argc; // suppress unused parameter warnings | |
17 (void) argv; // suppress unused parameter warnings | |
18 | |
19 UdpTransmitSocket transmitSocket( IpEndpointName( ADDRESS, PORT ) ); | |
20 | |
21 char buffer[OUTPUT_BUFFER_SIZE]; | |
22 osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE ); | |
23 | |
24 p << osc::BeginBundleImmediate | |
25 << osc::BeginMessage( "/test1" ) | |
26 << true << 23 << (float)3.1415 << "hello" << osc::EndMessage | |
27 << osc::BeginMessage( "/test2" ) | |
28 << true << 24 << (float)10.8 << "world" << osc::EndMessage | |
29 << osc::EndBundle; | |
30 | |
31 transmitSocket.Send( p.Data(), p.Size() ); | |
32 } | |
33 |