00001 /* 00002 * Network system TCP header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_NETWORK_SYSTEM_TCP_H__ 00009 #define __SP_NETWORK_SYSTEM_TCP_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 00014 #ifdef SP_COMPILE_WITH_NETWORKSYSTEM 00015 00016 00017 #include "Framework/Network/spNetworkSystem.hpp" 00018 #include "Framework/Network/spNetworkBase.hpp" 00019 00020 00021 namespace sp 00022 { 00023 namespace network 00024 { 00025 00026 00028 class SP_EXPORT NetworkSystemTCP : public NetworkBase, public NetworkSystem 00029 { 00030 00031 public: 00032 00033 NetworkSystemTCP(); 00034 ~NetworkSystemTCP(); 00035 00036 /* === Functions === */ 00037 00038 io::stringc getDescription() const; 00039 00040 NetworkServer* hostServer(u16 Port = DEFAULT_PORT); 00041 NetworkServer* joinServer(const io::stringc &IPAddress, u16 Port = DEFAULT_PORT); 00042 00043 void disconnect(); 00044 00045 bool sendPacket(const NetworkPacket &Packet, NetworkMember* Receiver = 0); 00046 bool receivePacket(NetworkPacket &Packet, NetworkMember* &Sender); 00047 00048 bool popClientJoinStack(NetworkClient* &Client); 00049 bool popClientLeaveStack(NetworkClient* &Client); 00050 00051 NetworkMember* getMemberByAddress(const NetworkAddress &Address); 00052 00053 private: 00054 00055 /* === Functions === */ 00056 00057 00058 00059 00060 }; 00061 00062 00063 } // /namespace network 00064 00065 } // /namespace sp 00066 00067 00068 #endif 00069 00070 #endif 00071 00072 00073 00074 // ================================================================================