Index: osgVisual/include/cluster/dataIO_clusterAsioTcpIostream.h
===================================================================
--- osgVisual/include/cluster/dataIO_clusterAsioTcpIostream.h	(revision 60)
+++ osgVisual/include/cluster/dataIO_clusterAsioTcpIostream.h	(revision 62)
@@ -18,22 +18,60 @@
 #include "dataIO_cluster.h"
 
+#include <osg/notify>
+#include <osg/ArgumentParser>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <boost/asio.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+
 namespace osgVisual
 {
 
-class dataIO_clusterAsioTcpIostream : public dataIO_cluster
+/**
+ * \brief This is a Boost ASIO iostream implementation of dataIO_cluster..
+ * 
+ * This class uses Boost ASIO and it iostream privider to fullfil the functions of dataIO_cluster.
+ * It sends the clusterdata into the network to any connected client.
+ * 
+ * 
+ * \todo Add getHorizonColor to transport it to slave for consistent fog.
+ * @author Torben Dannhauer
+ * @date  May 2010
+ */ 
+class dataIO_clusterAsioTcpIostream :	public dataIO_cluster
 {
+
 public:
+
 	dataIO_clusterAsioTcpIostream();
-	virtual ~dataIO_clusterAsioTcpIostream(void);
+	virtual ~dataIO_clusterAsioTcpIostream();
 
-	virtual void init( osg::ArgumentParser& arguments_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ );
-	virtual void shutdown();
-	virtual bool sendTO_OBJvaluesToSlaves() ;
-	virtual bool readTO_OBJvaluesFromMaster();
-	virtual void reportAsReadyToSwap();
-	virtual bool waitForSwap();
-	virtual bool waitForAllReadyToSwap();
-	virtual bool sendSwapCommand();
+	void init( osg::ArgumentParser& arguments_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ );
+	void shutdown();
+	bool sendTO_OBJvaluesToSlaves();
+	bool readTO_OBJvaluesFromMaster();
+	void reportAsReadyToSwap();
+	bool waitForSwap();
+	bool waitForAllReadyToSwap();
+	bool sendSwapCommand();
+
+private:
+	osgVisual::dataIO_cluster::clustermode clusterMode;
+	bool initialized;
+	int port;	// Defaults to 5678 
+	
+	/**
+	 * This list contains the connections to communicate with in each frame. 
+	 * 
+	 * As slave, contains only one entry: connection to master.
+	 * As Master,contains the connection to all slaves which use this connection.
+	 */ 
+	std::vector<boost::asio::ip::tcp::iostream> clientlists;
+
+	boost::asio::io_service io_service;
 };
 
-}	// END Namespace
+}	// END NAMESPACE
Index: osgVisual/src/cluster/dataIO_clusterAsioTcpIostream.cpp
===================================================================
--- osgVisual/src/cluster/dataIO_clusterAsioTcpIostream.cpp	(revision 60)
+++ osgVisual/src/cluster/dataIO_clusterAsioTcpIostream.cpp	(revision 62)
@@ -15,31 +15,71 @@
 */
 
-#include "..\..\include\cluster\dataIO_clusterAsioTcpIostream.h"
+#include "dataIO_clusterAsioTcpIostream.h"
 
 using namespace osgVisual;
 
-dataIO_clusterAsioTcpIostream::dataIO_clusterAsioTcpIostream()
+using boost::asio::ip::tcp;
+
+dataIO_clusterAsioTcpIostream::dataIO_clusterAsioTcpIostream() 
 {
-	OSG_NOTIFY( osg::ALWAYS ) << "clusterAsioTcpIostream constructed" << std::endl;
+	OSG_NOTIFY(osg::ALWAYS) << "dataIO_clusterAsioTcpIostream constructed" << std::endl;
+
+	port = 5678;
+	initialized = false;
 }
 
-dataIO_clusterAsioTcpIostream::~dataIO_clusterAsioTcpIostream(void)
+dataIO_clusterAsioTcpIostream::~dataIO_clusterAsioTcpIostream()
 {
-	OSG_NOTIFY( osg::ALWAYS ) << "clusterAsioTcpIostream destructed" << std::endl;
+	OSG_NOTIFY(osg::ALWAYS) << "dataIO_clusterAsioTcpIostream destructed" << std::endl;
 }
 
 void dataIO_clusterAsioTcpIostream::init( osg::ArgumentParser& arguments_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ )
 {
-	OSG_NOTIFY( osg::ALWAYS ) << "clusterAsioTcpIostream init()" << std::endl;
+	OSG_NOTIFY(osg::ALWAYS) << "dataIO_clusterAsioTcpIostream initialized" << std::endl;
+
+	clusterMode = clusterMode_;
+
+	if(clusterMode == osgVisual::dataIO_cluster::MASTER)
+	{
+		
+
+		tcp::endpoint endpoint(tcp::v4(), port);
+		tcp::acceptor acceptor(io_service, endpoint);
+
+										tcp::iostream stream;
+									
+										acceptor.accept(*stream.rdbuf());
+										tcp::no_delay option(true);
+										boost::system::error_code ec;
+										stream.rdbuf()->set_option(option, ec);
+										if (ec)
+										{
+											OSG_NOTIFY(osg::WARN) << "Error: Unable to set TCP_NODELAY option" << ec << std::endl;
+											// An error occurred.
+										}
+	}
+
+	if(clusterMode == osgVisual::dataIO_cluster::SLAVE)
+	{
+
+	}
+
+	initialized = true;
 }
 
 void dataIO_clusterAsioTcpIostream::shutdown()
 {
-	OSG_NOTIFY( osg::ALWAYS ) << "clusterAsioTcpIostream shutdown()" << std::endl;
+	OSG_NOTIFY(osg::ALWAYS) << "dataIO_clusterAsioTcpIostream shut down" << std::endl;
+
+	if(initialized)
+	{
+
+	}
 }
 
 bool dataIO_clusterAsioTcpIostream::sendTO_OBJvaluesToSlaves()
 {
-	OSG_NOTIFY( osg::INFO ) << "clusterAsioTcpIostream sendTO_OBJvaluesToSlaves()" << std::endl;
+	OSG_NOTIFY(osg::INFO) << "dataIO_clusterAsioTcpIostream::sendTO_OBJvaluesToSlaves()" << std::endl;
+
 	return true;
 }
@@ -47,5 +87,5 @@
 bool dataIO_clusterAsioTcpIostream::readTO_OBJvaluesFromMaster()
 {
-	OSG_NOTIFY( osg::INFO ) << "clusterAsioTcpIostream readTO_OBJvaluesFromMaster()" << std::endl;
+	OSG_NOTIFY(osg::INFO) << "dataIO_clusterAsioTcpIostream::readTO_OBJvaluesFromMaster()" << std::endl;
 
 	return true;
@@ -54,10 +94,11 @@
 void dataIO_clusterAsioTcpIostream::reportAsReadyToSwap()
 {
-	OSG_NOTIFY( osg::INFO ) << "clusterAsioTcpIostream reportAsReadyToSwap()" << std::endl;
+	OSG_NOTIFY(osg::INFO) << "dataIO_clusterAsioTcpIostream::reportAsReadyToSwap()" << std::endl;
 }
 
 bool dataIO_clusterAsioTcpIostream::waitForSwap()
 {
-	OSG_NOTIFY( osg::INFO ) << "clusterAsioTcpIostream waitForSwap()" << std::endl;
+	OSG_NOTIFY(osg::INFO) << "dataIO_clusterAsioTcpIostream::waitForAllReadyToSwap()" << std::endl;
+
 	return true;
 }
@@ -65,5 +106,6 @@
 bool dataIO_clusterAsioTcpIostream::waitForAllReadyToSwap()
 {
-	OSG_NOTIFY( osg::INFO ) << "clusterAsioTcpIostream waitForAllReadyToSwap()" << std::endl;
+	OSG_NOTIFY(osg::INFO) << "dataIO_clusterAsioTcpIostream::waitForAllReadyToSwap()" << std::endl;
+
 	return true;
 }
@@ -71,5 +113,6 @@
 bool dataIO_clusterAsioTcpIostream::sendSwapCommand()
 {
-	OSG_NOTIFY( osg::INFO ) << "clusterAsioTcpIostream sendSwapCommand()" << std::endl;
+	OSG_NOTIFY(osg::INFO) << "dataIO_clusterAsioTcpIostream::sendSwapCommand()" << std::endl;
+
 	return true;
 }
