c++ ptlib PNotifier 在 OPAL 中的使用



我正在使用OpalVoip制作软件电话应用程序,我遇到了以下问题:

void MyManager::main()
{
    //variables
    PNotifier notify; // this is the problem
    //it is the template PNotifierFunctionTemplate<INT>
    //more stuff 
    listener->Open(notify); 
    //listener is of type OpalListenerUDP
    //it should start the listener and wait for incoming connection
    //but however i need to pass this NOTIFY which should be the INT parameter to the
    //new OpalTransport instance created by the listener...
    //however OpalListenerUDP only creates OpalTransport after the connection is
    //accepted as so in following: OpalListenerUDP::Accept(/*time interval*/)
    //
    //So far I think that this notifier should be a pointer to an object of type
    //OpalListenerUDP but i have no idea how to get it done 
}

任何帮助将不胜感激,红色。

在对蛋白石源代码进行深入研究后,我找到了解决方案。事实证明,

OpalConnection::StartListener(OpalListener&);

将完成打开侦听器的工作,因此不需要调用OpalListener::Open(),所以只需要调用OpalListener::Accept即可接受连接。

最新更新