YAPOG  0.0.1
Yet Another Pokemon Online Game
ClientSocket.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_CLIENTSOCKET_HPP
2 # define YAPOG_CLIENTSOCKET_HPP
3 
4 # include <SFML/Network/TcpSocket.hpp>
5 
6 # include "YAPOG/Macros.hpp"
8 # include "YAPOG/System/String.hpp"
11 
12 namespace yap
13 {
14  struct IPacket;
15 
16  class YAPOG_LIB ClientSocket : public Socket
17  {
19 
20  public:
21 
22  ClientSocket ();
23  virtual ~ClientSocket ();
24 
25  bool Connect (const String& ipAddress, UInt16 port);
26  void Disconnect ();
27 
28  bool Send (IPacket& packet);
29  bool Receive (IPacket& packet);
30 
31  String GetRemoteAddress () const;
32  UInt16 GetRemotePort () const;
33 
34  sf::TcpSocket& GetInnerSocket ();
35 
36  private:
37 
38  static const bool DEFAULT_BLOCKING_STATE;
40 
41  sf::TcpSocket socket_;
42  };
43 } // namespace yap
44 
45 #endif // YAPOG_CLIENTSOCKET_HPP