📄 sipb_ipaddr.cpp
字号:
//sipb_ipaddr.cpp//Copyright (C) 2003 Metalink LTD//Author: Rodionov Sergey (seger@metalinkltd.com)//This program is distributed under terms of GPL (see LICENSE)#include "sipb_ipaddr.h"#include <netdb.h>sipb_ipaddr::sipb_ipaddr(){ if (!try_set("127.0.0.1")) //network is unrechable { _ip.s_addr=INADDR_ANY; _strip="0.0.0.0"; }}// bool sipb_ipaddr::try_set(string str){ hostent *hostinfo=gethostbyname(str.c_str()); if (hostinfo==NULL) return false; _strip=str; _ip=*(struct in_addr*)hostinfo->h_addr; return true;}//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -