00001 /** 00002 * @file framework/network.h 00003 * @brief Include all components of the network framework 00004 **************************************************************************** 00005 * @version 0.8.161 $Id: network.h 4195 2011-02-11 01:31:23Z alex $ 00006 * @author Alessandro Polo 00007 ****************************************************************************/ 00008 /*! @namespace wosh::network 00009 * @brief Specification and some implementations of common sockets (TCP, UDP) and networking-related classes. 00010 * WOSH Network Framework is required in order to build a (distributed) WOSH network, 00011 * protocols are (installed and) configured as Bundles (within NetworkManager settings). 00012 * Thanks to wosh::bundles::DiscoveryBundle service, a WOSH application may auto-connect 00013 * to other host without user interaction. 00014 * @see Refer to wosh::NetworkChannel, wosh::NetworkProtocol interfaces and wosh::NetworkManager core-module. 00015 * @see \ref page_framework_network 00016 * 00017 ****************************************************************************/ 00018 /*! \page page_framework 00019 * \htmlonly <hr/> \endhtmlonly 00020 * \section page_framework_network WOSH Network Framework 00021 * 00022 * wosh::network namespace offers a set of multi-platform classes for networking. 00023 * 00024 * The base blocks of the set are socket and server objects such as: 00025 * - wosh::network::SocketUdp 00026 * 00027 * - wosh::network::ServerTcp 00028 * - wosh::network::SocketTcp 00029 * 00030 * You may use this classes within your bundles. 00031 * Current implementation is based on QT4 Networking classes. 00032 * 00033 * wosh::bundles::DiscoveryBundle transmits and receives UDP datagrams using the SocketUdp class. 00034 * \code 00035 void sentDatagram() { 00036 char data[128]; 00037 memset(&data, '\0', 128); 00038 string addressport = "192.168.0.255:5634"; 00039 int byteSent = this->udpSocket.sendDatagram( addressport, &data, 128 ); 00040 } 00041 00042 void DiscoveryImpl::udpIncomingDatagram( const char * data, int maxSize, const std::string& source, SocketUdp* sourceSocket ) { 00043 // evaluate incoming -data- from -source- (address:port) 00044 } 00045 00046 * \endcode 00047 * 00048 * 00049 * [..] 00050 * 00051 * 00052 * Refer to wosh::NetworkChannel, wosh::NetworkProtocol and wosh::NetworkManager. 00053 * 00054 * 00055 ****************************************************************************/ 00056 /* Copyright (c) 2007-2011, WOSH - Wide Open Smart Home 00057 * by Alessandro Polo - OpenSmartHome.com 00058 * All rights reserved. 00059 * 00060 * Redistribution and use in source and binary forms, with or without 00061 * modification, are permitted provided that the following conditions are met: 00062 * * Redistributions of source code must retain the above copyright 00063 * notice, this list of conditions and the following disclaimer. 00064 * * Redistributions in binary form must reproduce the above copyright 00065 * notice, this list of conditions and the following disclaimer in the 00066 * documentation and/or other materials provided with the distribution. 00067 * * Neither the name of the OpenSmartHome.com WOSH nor the 00068 * names of its contributors may be used to endorse or promote products 00069 * derived from this software without specific prior written permission. 00070 * 00071 * THIS SOFTWARE IS PROVIDED BY Alessandro Polo ''AS IS'' AND ANY 00072 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00073 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00074 * DISCLAIMED. IN NO EVENT SHALL Alessandro Polo BE LIABLE FOR ANY 00075 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00076 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00077 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00078 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00079 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00080 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00081 ****************************************************************************/ 00082 00083 #ifndef __WOSH_FrameWork_Network_H__ 00084 #define __WOSH_FrameWork_Network_H__ 00085 00086 #include <woshDefs.h> 00087 00088 namespace wosh { 00089 namespace network { }; 00090 }; 00091 00092 #include <framework/network/ChannelTcpServer.h> 00093 #include <framework/network/ChannelTcpSocket.h> 00094 #include <framework/network/ChannelUdpSocket.h> 00095 00096 #include <framework/network/NetworkProtocolDBus.h> 00097 #include <framework/network/NetworkProtocolTcp.h> 00098 #include <framework/network/NetworkProtocolUdp.h> 00099 #include <framework/network/NetworkUtilities.h> 00100 00101 #include <framework/network/ServerTcp.h> 00102 #include <framework/network/SocketTcp.h> 00103 #include <framework/network/SocketUdp.h> 00104 00105 00106 #endif //__WOSH_FrameWork_Network_H__