tomwalters@570: September 28, 2005 tomwalters@570: ------------------ tomwalters@570: tomwalters@570: Compared to the previous official snapshot (November 2004) the tomwalters@570: current version of oscpack includes a re-written set of network tomwalters@570: classes and some changes to the syntax of the networking code. It no tomwalters@570: longer uses threads, which means that you don't need to use sleep() tomwalters@570: if you are writing a simple single-threaded server, or you need to tomwalters@570: spawn your own threads in a more complex application. tomwalters@570: tomwalters@570: The list below summarises the changes if you are porting code from tomwalters@570: the previous release. tomwalters@570: tomwalters@570: - there are no longer any threads in oscpack. if you need to tomwalters@570: set up an asynchronous listener you can create your own thread tomwalters@570: and call Run on an instance of SocketReceiveMultiplexer or tomwalters@570: UdpListeningReceiveSocket (see ip/UdpSocket.h) yourself. tomwalters@570: tomwalters@570: - host byte order is now used for network (IP) addresses tomwalters@570: tomwalters@570: - functions which used to take two parameters tomwalters@570: now take an instance of IpEndpointName (see tomwalters@570: ip/IpEndpointName.h) this class has a number of convenient tomwalters@570: constructors for converting numbers and strings to internet tomwalters@570: addresses. For example there is one which takes a string and tomwalters@570: another that take the dotted address components as separate tomwalters@570: parameters. tomwalters@570: tomwalters@570: - The UdpTransmitPort class, formerly in UdpTransmitPort.h, is tomwalters@570: now called UdpTransmitSocket, which is simply a convenience tomwalters@570: class derived from UdpSocket (see ip/UdpSocket.h). Where you tomwalters@570: used to use the constructor UdpTransmitPort( address, port) now tomwalters@570: you can use UdpTransmitSocket( IpEndpointName( address, port ) tomwalters@570: ) or you can any of the other possible ctors to IpEndpointName tomwalters@570: () (see above). The Send() method is unchanged. tomwalters@570: tomwalters@570: - The packet listener base class is now located in tomwalters@570: ip/PacketListener.h instead of PacketListenerPort.h. The tomwalters@570: ProcessPacket method now has an additional parameter indicating tomwalters@570: the remote endpoint tomwalters@570: tomwalters@570: - The preferred way to set up listeners is with tomwalters@570: SocketReceiveMultiplexer (in ip/UdpSocket.h), this also allows tomwalters@570: attaching periodic timers. For simple applications which only tomwalters@570: listen to a single socket with no timers you can use tomwalters@570: UdpListeningReceiveSocket (also in UdpSocket.h) See tomwalters@570: osc/OscReceiveTest.cpp or osc/OscDump.cpp for examples of this. tomwalters@570: This is more or less equivalent to the UdpPacketListenerPort tomwalters@570: object in the old oscpack versions except that you need to tomwalters@570: explicitly call Run() before it will start receiving packets tomwalters@570: and it runs in the same thread, not a separate thread so Run() tomwalters@570: won't usually return. tomwalters@570: tomwalters@570: - Explicit calls to InitializeNetworking() and tomwalters@570: TerminateNetworking() are no longer required for simple tomwalters@570: applications (more complex windows applications should tomwalters@570: instantiate NetworkInitializer in main() or WinMain (see tomwalters@570: ip/NetworkingUtils.h/.cpp) tomwalters@570: tomwalters@570: - The OscPacketListener base class (OscPacketListener.h) was tomwalters@570: added to make traversing OSC packets easier, it handles bundle tomwalters@570: traversal automatically so you only need to process messages in tomwalters@570: your derived classes. tomwalters@570: tomwalters@570: - On Windows be sure to link with ws2_32.lib or you will see tomwalters@570: a linker error about WSAEventSelect not being found. Also you tomwalters@570: will need to link with winmm.lib for timeGetTime() tomwalters@570: