Work-in-progress to reduce latency time:

* service->SendItem() now goes direct to pqistreamer buffer.
 * split p3FastService out of p3Service.
	p3FastService removes the recv buffer for faster processing.
	p3Service maintains its original interface, so derivate classes can remain unchanged.
 * Added uint32_t usec (wait period) to BinInterface.moretoread() & cansend() for future threading.
 * Added Mutex protection to pqistreamer, pqissl and derivatives of both.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6783 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2013-10-01 10:11:34 +00:00
parent 8e7fe9f79b
commit a7dd9ad9e3
24 changed files with 713 additions and 574 deletions

View file

@ -62,7 +62,7 @@ int pqipersongrp::tickServiceRecv()
RsRawItem *pqi = NULL;
int i = 0;
pqioutput(PQL_DEBUG_ALL, pqipersongrpzone, "pqipersongrp::tickTunnelServer()");
pqioutput(PQL_DEBUG_ALL, pqipersongrpzone, "pqipersongrp::tickServiceRecv()");
//p3ServiceServer::tick();
@ -70,8 +70,8 @@ int pqipersongrp::tickServiceRecv()
{
++i;
pqioutput(PQL_DEBUG_BASIC, pqipersongrpzone,
"pqipersongrp::tickTunnelServer() Incoming TunnelItem");
incoming(pqi);
"pqipersongrp::tickServiceRecv() Incoming TunnelItem");
recvItem(pqi);
}
if (0 < i)
@ -82,6 +82,11 @@ int pqipersongrp::tickServiceRecv()
}
// handle the tunnel services.
// Improvements:
// This function is no longer necessary, and data is pushed directly to pqihandler.
#if 0
int pqipersongrp::tickServiceSend()
{
RsRawItem *pqi = NULL;
@ -106,10 +111,12 @@ int pqipersongrp::tickServiceSend()
return 0;
}
#endif
// init
pqipersongrp::pqipersongrp(SecurityPolicy *glob, unsigned long flags)
:pqihandler(glob), pqil(NULL), initFlags(flags)
:pqihandler(glob), p3ServiceServer(this), pqil(NULL), initFlags(flags)
{
}
@ -130,6 +137,7 @@ int pqipersongrp::tick()
int i = 0;
#if 0
if (tickServiceSend())
{
i = 1;
@ -137,14 +145,18 @@ int pqipersongrp::tick()
std::cerr << "pqipersongrp::tick() moreToTick from tickServiceSend()" << std::endl;
#endif
}
#endif
if (pqihandler::tick()) /* does actual Send/Recv */
#if 0
if (pqihandler::tick()) /* does Send/Recv */
{
i = 1;
#ifdef PGRP_DEBUG
std::cerr << "pqipersongrp::tick() moreToTick from pqihandler::tick()" << std::endl;
#endif
}
#endif
if (tickServiceRecv())
@ -155,6 +167,19 @@ int pqipersongrp::tick()
#endif
}
p3ServiceServer::tick();
#if 1
if (pqihandler::tick()) /* does Send/Recv */
{
i = 1;
#ifdef PGRP_DEBUG
std::cerr << "pqipersongrp::tick() moreToTick from pqihandler::tick()" << std::endl;
#endif
}
#endif
return i;
}