front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/UdpSocket.h
changeset 28 9ccef81f02ab
parent 21 e4e5f02787a1
--- a/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/UdpSocket.h	Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/TuioClient/oscpack/ip/UdpSocket.h	Thu Apr 12 15:33:25 2012 +0200
@@ -1,31 +1,31 @@
 /*
-	oscpack -- Open Sound Control packet manipulation library
-	http://www.audiomulch.com/~rossb/oscpack
+    oscpack -- Open Sound Control packet manipulation library
+    http://www.audiomulch.com/~rossb/oscpack
 
-	Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
+    Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
 
-	Permission is hereby granted, free of charge, to any person obtaining
-	a copy of this software and associated documentation files
-	(the "Software"), to deal in the Software without restriction,
-	including without limitation the rights to use, copy, modify, merge,
-	publish, distribute, sublicense, and/or sell copies of the Software,
-	and to permit persons to whom the Software is furnished to do so,
-	subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files
+    (the "Software"), to deal in the Software without restriction,
+    including without limitation the rights to use, copy, modify, merge,
+    publish, distribute, sublicense, and/or sell copies of the Software,
+    and to permit persons to whom the Software is furnished to do so,
+    subject to the following conditions:
 
-	The above copyright notice and this permission notice shall be
-	included in all copies or substantial portions of the Software.
+    The above copyright notice and this permission notice shall be
+    included in all copies or substantial portions of the Software.
 
-	Any person wishing to distribute modifications to the Software is
-	requested to send the modifications to the original developer so that
-	they can be incorporated into the canonical version.
+    Any person wishing to distribute modifications to the Software is
+    requested to send the modifications to the original developer so that
+    they can be incorporated into the canonical version.
 
-	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-	EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-	MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-	IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-	ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-	CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-	WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+    ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+    CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 #ifndef INCLUDED_UDPSOCKET_H
 #define INCLUDED_UDPSOCKET_H
@@ -48,25 +48,25 @@
     class Implementation;
     Implementation *impl_;
 
-	friend class UdpSocket;
+    friend class UdpSocket;
 
 public:
     SocketReceiveMultiplexer();
     ~SocketReceiveMultiplexer();
 
-	// only call the attach/detach methods _before_ calling Run
+    // only call the attach/detach methods _before_ calling Run
 
     // only one listener per socket, each socket at most once
     void AttachSocketListener( UdpSocket *socket, PacketListener *listener );
     void DetachSocketListener( UdpSocket *socket, PacketListener *listener );
 
     void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener );
-	void AttachPeriodicTimerListener(
+    void AttachPeriodicTimerListener(
             int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener );
     void DetachPeriodicTimerListener( TimerListener *listener );  
 
     void Run();      // loop and block processing messages indefinitely
-	void RunUntilSigInt();
+    void RunUntilSigInt();
     void Break();    // call this from a listener to exit once the listener returns
     void AsynchronousBreak(); // call this from another thread or signal handler to exit the Run() state
 };
@@ -76,38 +76,38 @@
     class Implementation;
     Implementation *impl_;
     
-	friend class SocketReceiveMultiplexer::Implementation;
+    friend class SocketReceiveMultiplexer::Implementation;
     
 public:
 
-	// ctor throws std::runtime_error if there's a problem
-	// initializing the socket.
-	UdpSocket();
-	virtual ~UdpSocket();
+    // ctor throws std::runtime_error if there's a problem
+    // initializing the socket.
+    UdpSocket();
+    virtual ~UdpSocket();
 
-	// the socket is created in an unbound, unconnected state
-	// such a socket can only be used to send to an arbitrary
-	// address using SendTo(). To use Send() you need to first
-	// connect to a remote endpoint using Connect(). To use
-	// ReceiveFrom you need to first bind to a local endpoint
-	// using Bind().
+    // the socket is created in an unbound, unconnected state
+    // such a socket can only be used to send to an arbitrary
+    // address using SendTo(). To use Send() you need to first
+    // connect to a remote endpoint using Connect(). To use
+    // ReceiveFrom you need to first bind to a local endpoint
+    // using Bind().
 
-	// retrieve the local endpoint name when sending to 'to'
+    // retrieve the local endpoint name when sending to 'to'
     IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const;
 
-	// Connect to a remote endpoint which is used as the target
-	// for calls to Send()
-	void Connect( const IpEndpointName& remoteEndpoint );	
-	void Send( const char *data, int size );
+    // Connect to a remote endpoint which is used as the target
+    // for calls to Send()
+    void Connect( const IpEndpointName& remoteEndpoint );    
+    void Send( const char *data, int size );
     void SendTo( const IpEndpointName& remoteEndpoint, const char *data, int size );
 
 
-	// Bind a local endpoint to receive incoming data. Endpoint
-	// can be 'any' for the system to choose an endpoint
-	void Bind( const IpEndpointName& localEndpoint );
-	bool IsBound() const;
+    // Bind a local endpoint to receive incoming data. Endpoint
+    // can be 'any' for the system to choose an endpoint
+    void Bind( const IpEndpointName& localEndpoint );
+    bool IsBound() const;
 
-	int ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, int size );
+    int ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, int size );
 };
 
 
@@ -118,15 +118,15 @@
 
 class UdpTransmitSocket : public UdpSocket{
 public:
-	UdpTransmitSocket( const IpEndpointName& remoteEndpoint )
-		{ Connect( remoteEndpoint ); }
+    UdpTransmitSocket( const IpEndpointName& remoteEndpoint )
+        { Connect( remoteEndpoint ); }
 };
 
 
 class UdpReceiveSocket : public UdpSocket{
 public:
-	UdpReceiveSocket( const IpEndpointName& localEndpoint )
-		{ Bind( localEndpoint ); }
+    UdpReceiveSocket( const IpEndpointName& localEndpoint )
+        { Bind( localEndpoint ); }
 };
 
 
@@ -137,7 +137,7 @@
     SocketReceiveMultiplexer mux_;
     PacketListener *listener_;
 public:
-	UdpListeningReceiveSocket( const IpEndpointName& localEndpoint, PacketListener *listener )
+    UdpListeningReceiveSocket( const IpEndpointName& localEndpoint, PacketListener *listener )
         : listener_( listener )
     {
         Bind( localEndpoint );
@@ -149,7 +149,7 @@
 
     // see SocketReceiveMultiplexer above for the behaviour of these methods...
     void Run() { mux_.Run(); }
-	void RunUntilSigInt() { mux_.RunUntilSigInt(); }
+    void RunUntilSigInt() { mux_.RunUntilSigInt(); }
     void Break() { mux_.Break(); }
     void AsynchronousBreak() { mux_.AsynchronousBreak(); }
 };