gpt4 book ai didi

c++ ptlib PNotifier 在 OPAL 中的使用

转载 作者:太空宇宙 更新时间:2023-11-04 14:14:30 26 4
gpt4 key购买 nike

我正在使用 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
}

Red,我们将不胜感激。

最佳答案

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

OpalConnection::StartListener(OpalListener&);

将完成打开监听器的工作,因此无需调用 OpalListener::Open(),之后只需调用 OpalListener::Accept 即可接受连接。

关于c++ ptlib PNotifier 在 OPAL 中的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12433090/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com