mirror of
https://github.com/fumiama/simple-dict.git
synced 2026-06-13 15:01:00 +08:00
add timestamp in log
This commit is contained in:
3
server.c
3
server.c
@@ -720,7 +720,8 @@ static void accept_client(int fd) {
|
|||||||
char str[INET_ADDRSTRLEN]; // 16
|
char str[INET_ADDRSTRLEN]; // 16
|
||||||
inet_ntop(AF_INET, &in, str, sizeof(str));
|
inet_ntop(AF_INET, &in, str, sizeof(str));
|
||||||
#endif
|
#endif
|
||||||
printf("\nAccept client %s:%u at slot No.%d\n", str, port, p);
|
time_t t = time(NULL);
|
||||||
|
printf("\n> %sAccept client %s:%u at slot No.%d\n", ctime(&t), str, port, p);
|
||||||
thread_timer_t* timer = &timers[p];
|
thread_timer_t* timer = &timers[p];
|
||||||
timer->accept_fd = accept_fd;
|
timer->accept_fd = accept_fd;
|
||||||
timer->index = p;
|
timer->index = p;
|
||||||
|
|||||||
Reference in New Issue
Block a user