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

📄 sipb_sendrecv_udp.h

📁 sip torture test tools
💻 H
字号:
//sipb_sendrecv_upd.h//Copyright (C) 2003 Metalink LTD//Author: Rodionov Sergey (seger@metalinkltd.com)//This program is distributed under terms of GPL (see LICENSE)#ifndef __SEGER__MLTD__SIPB_SENDRECV_UDP_H__#define __SEGER__MLTD__SIPB_SENDRECV_UDP_H__#include <sys/socket.h>#include <netinet/in.h>#include <unistd.h>#include <string>using namespace std;class sipb_sendrecv_udp{ public:   sipb_sendrecv_udp();   ~sipb_sendrecv_udp(){close(soc);};      int get_port();   void rebind();  //change port   //for send and recive   bool make_connect(in_addr addr,int port);  //false if some error   bool sendudp(const string& to_send);      //run it after make_connect (if not return false)      //if error return false (may be message to big or hung up)   bool check_hungup();  //must be connect (run it after sendudp)   bool recvudp(in_addr& s_addr,int& s_port,string& to_recv, int ms_timeout);       //MUST NOT BE CONNECT!       //ms_timout --> timeout in milliseconds   bool is_connect(){return _is_connect;};      //its useful run it after sendudp or recvudp return false !      //(may be disconnect) private:   int soc;   bool _is_connect;};#endif

⌨️ 快捷键说明

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