#include <errno.h>
#include <signal.h>
#include <stdio.h>
+#include <time.h>
#include <iostream>
#include <string>
{
socket_server ss("./socket");
+ time_t t0 = time(NULL);
+
// max 10 sec
- for (int i=0; i < 10; i++)
+ while (time(NULL) < t0 + 10 )
{
ss.fill_buffer(1000000);
socket_server ss("./socket");
ss.set_logging(&cerr,debug);
+ time_t t0 = time(NULL);
+
// max 10 sec
- for (int i=0; i < 10; i++)
+ while (time(NULL) < t0 + 10 )
{
ss.fill_buffer(1000000);
socket_server ss("./socket");
ss.set_logging(&cerr,debug);
+ time_t t0 = time(NULL);
+
// max 10 sec
- for (int i=0; i < 10; i++)
+ while (time(NULL) < t0 + 10 )
{
ss.fill_buffer(1000000);
con->write(string().insert(0,100*1024,'y'));
}
}
+ std::cerr << "child: OVER" << std::endl;
// don't call atexit and stuff
_exit(0);
}
{
socket_server ss(6666);
+ time_t t0 = time(NULL);
+
// max 10 sec
- for (int i=0; i < 10; i++)
+ while (time(NULL) < t0 + 10 )
{
ss.fill_buffer(1000000);
socket_server ss(6666);
ss.set_logging(&cerr,debug);
+ time_t t0 = time(NULL);
+
// max 10 sec
- for (int i=0; i < 10; i++)
+ while (time(NULL) < t0 + 10 )
{
ss.fill_buffer(1000000);
socket_server ss(6666);
ss.set_logging(&cerr,debug);
+ time_t t0 = time(NULL);
+
// max 10 sec
- for (int i=0; i < 10; i++)
+ while (time(NULL) < t0 + 10 )
{
ss.fill_buffer(1000000);