|
@@ -351,6 +351,11 @@ void NetIO::ing_authenticate_new_client(tcp::socket* csocket,
|
|
|
ing_start_accept();
|
|
|
}
|
|
|
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+static size_t stg_clients_connected = 0;
|
|
|
+static size_t stg_clients_authenticated = 0;
|
|
|
+#endif
|
|
|
+
|
|
|
/*
|
|
|
Handle new client connections.
|
|
|
New clients always send an authentication message.
|
|
@@ -384,6 +389,15 @@ void NetIO::stg_authenticate_new_client(tcp::socket* csocket,
|
|
|
return;
|
|
|
}
|
|
|
else {
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ ++stg_clients_connected;
|
|
|
+ if (stg_clients_connected % 1000 == 0) {
|
|
|
+ struct timeval now;
|
|
|
+ gettimeofday(&now, NULL);
|
|
|
+ printf("%lu.%06lu: STG %lu clients connected\n",
|
|
|
+ now.tv_sec, now.tv_usec, stg_clients_connected);
|
|
|
+ }
|
|
|
+#endif
|
|
|
clientid_t c_simid = *((clientid_t *)(auth_message));
|
|
|
// Read the authentication token
|
|
|
unsigned char *auth_ptr = auth_message + sizeof(clientid_t);
|
|
@@ -397,6 +411,15 @@ void NetIO::stg_authenticate_new_client(tcp::socket* csocket,
|
|
|
if(ret) {
|
|
|
uint32_t lcid = c_simid / num_stg_nodes;
|
|
|
client_sockets[lcid] = csocket;
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ ++stg_clients_authenticated;
|
|
|
+ if (stg_clients_authenticated % 1000 == 0) {
|
|
|
+ struct timeval now;
|
|
|
+ gettimeofday(&now, NULL);
|
|
|
+ printf("%lu.%06lu: STG %lu clients authenticated\n",
|
|
|
+ now.tv_sec, now.tv_usec, stg_clients_authenticated);
|
|
|
+ }
|
|
|
+#endif
|
|
|
}
|
|
|
else{
|
|
|
printf("Client <-> Storage authentication failed\n");
|
|
@@ -442,6 +465,11 @@ void NetIO::send_client_mailbox()
|
|
|
unsigned long start = tp.tv_sec * 1000000 + tp.tv_nsec/1000;
|
|
|
#endif
|
|
|
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ size_t clients_without_sockets = 0;
|
|
|
+ size_t mailboxes_queued = 0;
|
|
|
+#endif
|
|
|
+
|
|
|
// Send each client their tokens for the next epoch
|
|
|
for(uint32_t lcid = 0; lcid < num_clients_per_stg; lcid++)
|
|
|
{
|
|
@@ -482,14 +510,22 @@ void NetIO::send_client_mailbox()
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ ++mailboxes_queued;
|
|
|
+ } else {
|
|
|
+ ++clients_without_sockets;
|
|
|
+#endif
|
|
|
}
|
|
|
- /*
|
|
|
- else {
|
|
|
- printf("Client did not have a socket!\n");
|
|
|
- }
|
|
|
- */
|
|
|
}
|
|
|
|
|
|
+#ifdef TRACE_SOCKIO
|
|
|
+ struct timeval now;
|
|
|
+ gettimeofday(&now, NULL);
|
|
|
+ printf("%lu.%06lu: STG queued %lu mailboxes; %lu clients without sockets\n",
|
|
|
+ now.tv_sec, now.tv_usec, mailboxes_queued,
|
|
|
+ clients_without_sockets);
|
|
|
+#endif
|
|
|
+
|
|
|
#ifdef PROFILE_NET_CLIENTS
|
|
|
clock_gettime(CLOCK_REALTIME_COARSE, &tp);
|
|
|
unsigned long end = tp.tv_sec * 1000000 + tp.tv_nsec/1000;
|