siptransmitter.h

来自「一个SIP协议栈」· C头文件 代码 · 共 59 行

H
59
字号
#ifndef __SIPTRANSMITTER_H__#define __SIPTRANSMITTER_H__#include "mstring.h"#include "IPAddress.h"#include "TCPSocket.h"#include "UDPSocket.h"namespace msip{    ///Send via TCP or UDP protocols.    enum SendVia    {        viaUDP,        viaTCP    };    ///Transmitter class    class Transmitter    {    private:        ///Internet address         mh323::IPAddress* tr_IPAddress;        /** TCP Socket. It would be fine to use one abstract class            "Socket" but TCP and UDP have quite different algorithms            of work so that we have to use two different classes */        mh323::TCPSocket* tr_TCPSocket;        /// UDP Socket.        mh323::UDPSocket* tr_UDPSocket;    public:        /// Default constructor        Transmitter();        /// Destructor        ~Transmitter();        /// Create connection        bool connect(SendVia via, const std::string & addr, int port=0);        /// Close connection        bool close();        /// Send a message via connection        bool send(const std::mstring& msg);    };}#endif

⌨️ 快捷键说明

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