00001
00002
00003
00004
#ifndef __NET_HOST_H
00005
#define __NET_HOST_H
00006
00007
#include "system.h"
00008
#include "net_stdafx.h"
00009
00010
#include <string>
00011
00012
00013
namespace Net{
00014
using namespace std;
00016 class HostException:
public System::Exception{
00017
public:
00019 HostException(): Exception("
HostException unknow host",""){};
00021 HostException(
char* host): Exception("
HostException unknow host['%s']",host){};
00022 };
00023
00025 class Host{
00026
private:
00028
struct sockaddr_in sin;
00029
public:
00031
Host();
00033
Host(
struct sockaddr_in s);
00035
Host(
struct sockaddr_in s,
unsigned int port);
00037
Host(
Host &h,
unsigned int port);
00039
Host(
char* host,
unsigned int port);
00040
00042
void getSin(
struct sockaddr_in *s);
00043
00044
00045
00046 };
00047 }
00048
00049
00050
#endif // __NET_HOST_H