Mercurial > archived > louis > epitech > zia-api
view include/network/IEndPoint.hpp @ 69:c9ebb8ea24e2
Improve portability
author | Thomas Sanchez <> |
---|---|
date | Wed, 31 Mar 2010 00:00:46 +0200 |
parents | 86584ae719fc |
children | bf311f8f6f57 |
line wrap: on
line source
#ifndef __ZIA_API_IENDPOINT_HPP_ # define __ZIA_API_IENDPOINT_HPP_ # include <string> # if WIN32 # include <winsock2.h> # endif namespace zia { namespace api { namespace network { /** * @brief Represent a connection point. * */ class IEndPoint { public: typedef int Ip; typedef unsigned short Port; # if WIN32 typedef SOCKET Socket; # else typedef int Socket; # endif typedef std::string IAddress; virtual ~IEndPoint(void){} /** * @brief Get on wich port socket is connected. * * @return The port number. */ virtual Port getPort(void) const = 0; virtual const Ip & getIp(void) const = 0; /** * @brief Get the socket associated with the endpoint. * * @return The socket. */ virtual Socket getSocket(void) const = 0; }; }; }; }; #endif /* ! __ZIA_API_IENDPOINT_HPP_ */