aboutsummaryrefslogtreecommitdiff
path: root/src/stable/client.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2023-07-26 21:33:36 -0700
committerMike Buland <eichlan@xagasoft.com>2023-07-26 21:33:36 -0700
commite43a2cac32cb773994b11a3d964ec4acc372d273 (patch)
tree9e281be52f9dd8b80855c7d3cb9ec3df9cdd0ad3 /src/stable/client.cpp
parentb544779d5b759d4ab2b82654e3f53b82ea41bac7 (diff)
downloadlibbu++-e43a2cac32cb773994b11a3d964ec4acc372d273.tar.gz
libbu++-e43a2cac32cb773994b11a3d964ec4acc372d273.tar.bz2
libbu++-e43a2cac32cb773994b11a3d964ec4acc372d273.tar.xz
libbu++-e43a2cac32cb773994b11a3d964ec4acc372d273.zip
Added a profiler and investageted Server.
Diffstat (limited to '')
-rw-r--r--src/stable/client.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/stable/client.cpp b/src/stable/client.cpp
index f6feb7c..56c5094 100644
--- a/src/stable/client.cpp
+++ b/src/stable/client.cpp
@@ -16,6 +16,13 @@
16 16
17/** Read buffer size. */ 17/** Read buffer size. */
18#define RBS (2000) // 1500 is the nominal MTU for ethernet, it's a good guess 18#define RBS (2000) // 1500 is the nominal MTU for ethernet, it's a good guess
19#ifdef PROFILE_BU_SERVER
20#define BU_PROFILE_START( x ) Bu::Profiler::getInstance().startEvent( x )
21#define BU_PROFILE_END( x ) Bu::Profiler::getInstance().endEvent( x )
22#else
23#define BU_PROFILE_START( x ) (void)0
24#define BU_PROFILE_END( x ) (void)0
25#endif
19 26
20Bu::Client::Client( Bu::TcpSocket *pSocket, 27Bu::Client::Client( Bu::TcpSocket *pSocket,
21 class Bu::ClientLinkFactory *pfLink ) : 28 class Bu::ClientLinkFactory *pfLink ) :
@@ -47,6 +54,7 @@ void Bu::Client::processInput()
47 char buf[RBS]; 54 char buf[RBS];
48 Bu::size nRead, nTotal=0; 55 Bu::size nRead, nTotal=0;
49 56
57 BU_PROFILE_START("client.read");
50 for(;;) 58 for(;;)
51 { 59 {
52 try 60 try
@@ -72,6 +80,7 @@ void Bu::Client::processInput()
72 break; 80 break;
73 } 81 }
74 } 82 }
83 BU_PROFILE_END("client.read");
75 mRead.unlock(); 84 mRead.unlock();
76 85
77 if( nTotal == 0 ) 86 if( nTotal == 0 )
@@ -82,7 +91,9 @@ void Bu::Client::processInput()
82 91
83 if( pProto && nTotal ) 92 if( pProto && nTotal )
84 { 93 {
94 BU_PROFILE_START("client.process");
85 pProto->onNewData( this ); 95 pProto->onNewData( this );
96 BU_PROFILE_END("client.process");
86 } 97 }
87} 98}
88 99