MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / destroyPool

Function destroyPool

engine/Poseidon/Network/NetTransportNet.cpp:85–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 {
84 pool = new NetPool(new PeerChannelFactoryUDP, nullptr, nullptr);
85 }
86 return pool;
87}
88
89static void destroyPool()
90// should be called inside of poolLock.enter()
91{
92 if (clientPeer)
93 {
94 if (pool)
95 {
96 pool->deletePeer(clientPeer);
97 }
98 else
99 {
100 clientPeer->close();
101 }
102 clientPeer = nullptr;
103 }
104 if (serverPeer)
105 {
106 if (pool)
107 {
108 pool->deletePeer(serverPeer);
109 }
110 else
111 {
112 serverPeer->close();
113 }
114 serverPeer = nullptr;
115 }
116 if (pool)
117 {
118 pool = nullptr;
119 }

Callers 2

checkPoolFunction · 0.85

Calls 2

deletePeerMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected