string errormsg;
- try
- {
- socket_client_connection sc("./socket");
- command_client cc(sc,1000000,1000000);
- }
- catch(t2n_transfer_error &e)
- { errormsg=e.what(); }
- catch(...)
- { throw; }
+ socket_client_connection sc("./socket");
- CPPUNIT_ASSERT_EQUAL(string("error reading from socket : Invalid argument"),errormsg);
+ CPPUNIT_ASSERT_EQUAL(true,sc.connection::is_closed());
}
}
}
try
{
- command_client cc(sc,1000000,1000000);
+ command_client cc(&sc,1000000,1000000);
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
{ throw; }
CPPUNIT_ASSERT_EQUAL(string("timeout exceeded"),errormsg);
+
+ kill(pid,SIGKILL);
}
}
}
try
{
- command_client cc(sc,1000000,1000000);
+ command_client cc(&sc,1000000,1000000);
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
{ throw; }
CPPUNIT_ASSERT_EQUAL(string("timeout exceeded"),errormsg);
+
+ kill(pid,SIGKILL);
}
}
}
sleep(1);
socket_client_connection sc("./socket");
- command_client cc(sc,1000000,1000000);
+ command_client cc(&sc,1000000,1000000);
result_container rc;
string errormsg;
{ throw; }
CPPUNIT_ASSERT_EQUAL(string("timeout exceeded"),errormsg);
+
+ kill(pid,SIGKILL);
}
}
}
sleep(1);
socket_client_connection sc("./socket");
- command_client cc(sc,1000000,1000000);
+ command_client cc(&sc,1000000,1000000);
result_container rc;
string errormsg;
{ throw; }
CPPUNIT_ASSERT_EQUAL(string("timeout exceeded"),errormsg);
+
+ kill(pid,SIGKILL);
}
}
}
{ throw; }
CPPUNIT_ASSERT_EQUAL(string("write() returned Broken pipe"),errormsg);
+
+ kill(pid,SIGKILL);
}
}
}
void DisconnectOnRead()
{
- pid_t pid;
+ pid_t pid1, pid2;
- switch(pid=fork())
+ switch(pid1=fork())
{
case -1:
{
// are we still alive and able to process data?
- switch(pid=fork())
+ switch(pid2=fork())
{
case -1:
{
}
}
}
+ kill(pid1,SIGKILL);
+ kill(pid2,SIGKILL);
}
void BreakAccept()
{
- pid_t pid;
+ pid_t pid1,pid2;
- switch(pid=fork())
+ switch(pid1=fork())
{
case -1:
{
// are we still alive and able to process data?
- switch(pid=fork())
+ switch(pid2=fork())
{
case -1:
{
}
}
}
+ kill(pid1,SIGKILL);
+ kill(pid2,SIGKILL);
}
};