removed NetworkPort.cpp

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2022-05-26 19:41:47 +08:00
parent 30dc9c4701
commit 65b1eda6c3
2 changed files with 0 additions and 52 deletions

View File

@ -87,8 +87,6 @@ namespace hgl
namespace network
{
const uint16 GetPort(const char *scheme);
int CreateSocket(const IPAddress *); ///<创建Socket
void CloseSocket(int); ///<关闭socket

View File

@ -1,50 +0,0 @@
#include<hgl/type/DataType.h>
#include<hgl/type/StrChar.h>
namespace hgl
{
namespace network
{
namespace
{
struct SchemePort
{
uint16 port;
char scheme[8];
};
const SchemePort SchemePortList[]=
{
{21, "ftp"},
{22, "ssh"},
{23, "telnet"},
{25, "smtp"},
{53, "dns"},
{80, "http"},
{80, "ws"},
{119, "nntp"},
{143, "imap"},
{389, "ldap"},
{443, "https"},
{443, "wss"},
{465, "smtps"},
{554, "rtsp"},
{636, "ldaps"},
{853, "dnss"},
{993, "imaps"},
{5060, "sip"},
{5061, "sips"},
{5222, "xmpp"}
};
}
const uint16 GetPort(const char *scheme)
{
for(const SchemePort &sp:SchemePortList)
if(strcmp(scheme,sp.scheme)==0)
return sp.port;
return 0;
}
}//namespace network
}//namespace hgl