mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-17 05:25:57 +08:00
创建Socket优先绑定本线程
This commit is contained in:
@@ -41,12 +41,12 @@ UDPServer::~UDPServer() {
|
||||
InfoL;
|
||||
}
|
||||
|
||||
Socket::Ptr UDPServer::getSock(const char* strLocalIp, int intervaled,uint16_t iLocalPort) {
|
||||
Socket::Ptr UDPServer::getSock(const EventPoller::Ptr &poller,const char* strLocalIp, int intervaled,uint16_t iLocalPort) {
|
||||
lock_guard<mutex> lck(_mtxUpdSock);
|
||||
string strKey = StrPrinter << strLocalIp << ":" << intervaled << endl;
|
||||
auto it = _mapUpdSock.find(strKey);
|
||||
if (it == _mapUpdSock.end()) {
|
||||
Socket::Ptr pSock(new Socket());
|
||||
Socket::Ptr pSock(new Socket(poller));
|
||||
//InfoL<<localIp;
|
||||
if (!pSock->bindUdpSock(iLocalPort, strLocalIp)) {
|
||||
//分配失败
|
||||
|
||||
Reference in New Issue
Block a user