mirror of
https://github.com/oatpp/oatpp.git
synced 2025-02-23 17:40:28 +08:00
Log Connection.
This commit is contained in:
parent
69e8eb34fc
commit
11e154735c
@ -79,13 +79,15 @@ Connection::~Connection(){
|
||||
data::v_io_size Connection::write(const void *buff, v_buff_size count, async::Action& action){
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
|
||||
OATPP_LOGD("AAA", "Connection[%d] write want %d", this, count);
|
||||
auto result = ::send(m_handle, (const char*) buff, (int)count, 0);
|
||||
|
||||
OATPP_LOGD("AAA", "Connection[%d] write %d", this, result);
|
||||
if(result == SOCKET_ERROR) {
|
||||
|
||||
auto e = WSAGetLastError();
|
||||
|
||||
OATPP_LOGD("AAA", "Connection[%d] write error %d mode=%d", this, e, m_mode);
|
||||
|
||||
if(e == WSAEWOULDBLOCK){
|
||||
if(m_mode == data::stream::ASYNCHRONOUS) {
|
||||
action = oatpp::async::Action::createIOWaitAction(m_handle, oatpp::async::Action::IOEventType::IO_EVENT_WRITE);
|
||||
@ -136,13 +138,15 @@ data::v_io_size Connection::write(const void *buff, v_buff_size count, async::Ac
|
||||
data::v_io_size Connection::read(void *buff, v_buff_size count, async::Action& action){
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
|
||||
OATPP_LOGD("AAA", "Connection[%d] read want %d", this, count);
|
||||
auto result = ::recv(m_handle, (char*)buff, (int)count, 0);
|
||||
|
||||
OATPP_LOGD("AAA", "Connection[%d] read %d", this, result);
|
||||
if(result == SOCKET_ERROR) {
|
||||
|
||||
auto e = WSAGetLastError();
|
||||
|
||||
OATPP_LOGD("AAA", "Connection[%d] read error %d mode=%d", this, e, m_mode);
|
||||
|
||||
if(e == WSAEWOULDBLOCK){
|
||||
if(m_mode == data::stream::ASYNCHRONOUS) {
|
||||
action = oatpp::async::Action::createIOWaitAction(m_handle, oatpp::async::Action::IOEventType::IO_EVENT_READ);
|
||||
|
@ -108,30 +108,30 @@ void runTests() {
|
||||
|
||||
OATPP_RUN_TEST(oatpp::test::web::server::handler::AuthorizationHandlerTest);
|
||||
*/
|
||||
{
|
||||
|
||||
oatpp::test::web::PipelineTest test_virtual(0, 3000);
|
||||
test_virtual.run();
|
||||
|
||||
oatpp::test::web::PipelineTest test_port(8000, 3000);
|
||||
test_port.run();
|
||||
|
||||
}
|
||||
// {
|
||||
//
|
||||
// oatpp::test::web::PipelineTest test_virtual(0, 3000);
|
||||
// test_virtual.run();
|
||||
//
|
||||
// oatpp::test::web::PipelineTest test_port(8000, 3000);
|
||||
// test_port.run();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// {
|
||||
//
|
||||
// oatpp::test::web::PipelineAsyncTest test_virtual(0, 3000);
|
||||
// test_virtual.run();
|
||||
//
|
||||
// oatpp::test::web::PipelineAsyncTest test_port(8000, 3000);
|
||||
// test_port.run();
|
||||
//
|
||||
// }
|
||||
|
||||
{
|
||||
|
||||
oatpp::test::web::PipelineAsyncTest test_virtual(0, 3000);
|
||||
test_virtual.run();
|
||||
|
||||
oatpp::test::web::PipelineAsyncTest test_port(8000, 3000);
|
||||
test_port.run();
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
oatpp::test::web::FullTest test_virtual(0, 1000);
|
||||
test_virtual.run();
|
||||
// oatpp::test::web::FullTest test_virtual(0, 1000);
|
||||
// test_virtual.run();
|
||||
|
||||
oatpp::test::web::FullTest test_port(8000, 5);
|
||||
test_port.run();
|
||||
@ -140,8 +140,8 @@ void runTests() {
|
||||
|
||||
{
|
||||
|
||||
oatpp::test::web::FullAsyncTest test_virtual(0, 1000);
|
||||
test_virtual.run();
|
||||
// oatpp::test::web::FullAsyncTest test_virtual(0, 1000);
|
||||
// test_virtual.run();
|
||||
|
||||
oatpp::test::web::FullAsyncTest test_port(8000, 5);
|
||||
test_port.run();
|
||||
@ -150,8 +150,8 @@ void runTests() {
|
||||
|
||||
{
|
||||
|
||||
oatpp::test::web::FullAsyncClientTest test_virtual(0, 1000);
|
||||
test_virtual.run(20);
|
||||
// oatpp::test::web::FullAsyncClientTest test_virtual(0, 1000);
|
||||
// test_virtual.run(20);
|
||||
|
||||
oatpp::test::web::FullAsyncClientTest test_port(8000, 10);
|
||||
test_port.run(1);
|
||||
@ -160,8 +160,8 @@ void runTests() {
|
||||
|
||||
{
|
||||
|
||||
oatpp::test::web::ClientRetryTest test_virtual(0);
|
||||
test_virtual.run();
|
||||
// oatpp::test::web::ClientRetryTest test_virtual(0);
|
||||
// test_virtual.run();
|
||||
|
||||
oatpp::test::web::ClientRetryTest test_port(8000);
|
||||
test_port.run();
|
||||
|
Loading…
Reference in New Issue
Block a user