mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-10-11 13:08:47 -04:00
implemented multiple clients in Friend Server
This commit is contained in:
parent
21ea281df4
commit
8e4a9e6a38
6 changed files with 246 additions and 63 deletions
|
@ -9,11 +9,9 @@ void FriendServer::threadTick()
|
|||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
|
||||
pqi->tick();
|
||||
|
||||
RsItem *item;
|
||||
|
||||
while(nullptr != (item = pqi->GetItem()))
|
||||
while(nullptr != (item = mni->GetItem()))
|
||||
{
|
||||
RsFriendServerItem *fsitem = dynamic_cast<RsFriendServerItem*>(item);
|
||||
|
||||
|
@ -23,6 +21,7 @@ void FriendServer::threadTick()
|
|||
|
||||
continue;
|
||||
}
|
||||
std::cerr << "Received item: " << std::endl << *fsitem << std::endl;
|
||||
|
||||
switch(fsitem->PacketSubType())
|
||||
{
|
||||
|
@ -57,11 +56,6 @@ void FriendServer::run()
|
|||
mni = new FsNetworkInterface;
|
||||
mni->start();
|
||||
|
||||
RsSerialiser *rss = new RsSerialiser ;
|
||||
rss->addSerialType(new FsSerializer) ;
|
||||
|
||||
pqi = new pqistreamer(rss, RsPeerId(), mni,BIN_FLAGS_READABLE);
|
||||
|
||||
while(!shouldStop()) { threadTick() ; }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue