mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
wrap m_OpenSockets with mutex
This commit is contained in:
parent
5f525d0e43
commit
73b3fbc2da
2 changed files with 12 additions and 7 deletions
|
@ -182,7 +182,7 @@ namespace client
|
|||
/** send raw data to remote endpoint from our UDP Socket */
|
||||
void SendTo(const uint8_t * buf, size_t len, std::shared_ptr<boost::asio::ip::udp::endpoint> remote);
|
||||
|
||||
void RemoveSocket(const SAMSocket * socket);
|
||||
void RemoveSocket(const std::shared_ptr<SAMSocket> & socket);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -204,6 +204,7 @@ namespace client
|
|||
boost::asio::ip::udp::socket m_DatagramSocket;
|
||||
mutable std::mutex m_SessionsMutex;
|
||||
std::map<std::string, std::shared_ptr<SAMSession> > m_Sessions;
|
||||
mutable std::mutex m_OpenSocketsMutex;
|
||||
std::list<std::shared_ptr<SAMSocket> > m_OpenSockets;
|
||||
uint8_t m_DatagramReceiveBuffer[i2p::datagram::MAX_DATAGRAM_SIZE+1];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue