4 Compared to the previous official snapshot (November 2004) the
\r
5 current version of oscpack includes a re-written set of network
\r
6 classes and some changes to the syntax of the networking code. It no
\r
7 longer uses threads, which means that you don't need to use sleep()
\r
8 if you are writing a simple single-threaded server, or you need to
\r
9 spawn your own threads in a more complex application.
\r
11 The list below summarises the changes if you are porting code from
\r
12 the previous release.
\r
14 - there are no longer any threads in oscpack. if you need to
\r
15 set up an asynchronous listener you can create your own thread
\r
16 and call Run on an instance of SocketReceiveMultiplexer or
\r
17 UdpListeningReceiveSocket (see ip/UdpSocket.h) yourself.
\r
19 - host byte order is now used for network (IP) addresses
\r
21 - functions which used to take two parameters <address, port>
\r
22 now take an instance of IpEndpointName (see
\r
23 ip/IpEndpointName.h) this class has a number of convenient
\r
24 constructors for converting numbers and strings to internet
\r
25 addresses. For example there is one which takes a string and
\r
26 another that take the dotted address components as separate
\r
29 - The UdpTransmitPort class, formerly in UdpTransmitPort.h, is
\r
30 now called UdpTransmitSocket, which is simply a convenience
\r
31 class derived from UdpSocket (see ip/UdpSocket.h). Where you
\r
32 used to use the constructor UdpTransmitPort( address, port) now
\r
33 you can use UdpTransmitSocket( IpEndpointName( address, port )
\r
34 ) or you can any of the other possible ctors to IpEndpointName
\r
35 () (see above). The Send() method is unchanged.
\r
37 - The packet listener base class is now located in
\r
38 ip/PacketListener.h instead of PacketListenerPort.h. The
\r
39 ProcessPacket method now has an additional parameter indicating
\r
42 - The preferred way to set up listeners is with
\r
43 SocketReceiveMultiplexer (in ip/UdpSocket.h), this also allows
\r
44 attaching periodic timers. For simple applications which only
\r
45 listen to a single socket with no timers you can use
\r
46 UdpListeningReceiveSocket (also in UdpSocket.h) See
\r
47 osc/OscReceiveTest.cpp or osc/OscDump.cpp for examples of this.
\r
48 This is more or less equivalent to the UdpPacketListenerPort
\r
49 object in the old oscpack versions except that you need to
\r
50 explicitly call Run() before it will start receiving packets
\r
51 and it runs in the same thread, not a separate thread so Run()
\r
52 won't usually return.
\r
54 - Explicit calls to InitializeNetworking() and
\r
55 TerminateNetworking() are no longer required for simple
\r
56 applications (more complex windows applications should
\r
57 instantiate NetworkInitializer in main() or WinMain (see
\r
58 ip/NetworkingUtils.h/.cpp)
\r
60 - The OscPacketListener base class (OscPacketListener.h) was
\r
61 added to make traversing OSC packets easier, it handles bundle
\r
62 traversal automatically so you only need to process messages in
\r
63 your derived classes.
\r
65 - On Windows be sure to link with ws2_32.lib or you will see
\r
66 a linker error about WSAEventSelect not being found. Also you
\r
67 will need to link with winmm.lib for timeGetTime()
\r