⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagesocket.cpp

📁 KphoneSI (kpsi) is a SIP (Session Initiation Protocol) user agent for Linux, with which you can in
💻 CPP
字号:
#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <time.h>#include "../kphone/kstatics.h"#include "messagesocket.h"MessageSocket::MessageSocket( void ){	type = None;	bound = false;}MessageSocket::~MessageSocket( void ){}bool MessageSocket::setHostname( const char *hostname ){	time_t begin, end;	double gaidiff;		if(KStatics::noLine >=1 ) {		    return  false;	}			time(&begin); 	he = gethostbyname( hostname );	time(&end);	gaidiff=difftime(end,begin);	if (gaidiff > 0.9E1) {	        KStatics::noLine=1;	}	if ( he  == NULL ) {		perror( "MessageSocket::setHostname(): gethostbyname() failed" );		return false;	}	return true;}void MessageSocket::forcePortNumber( unsigned int newport ){	ourport = newport;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -