Skip to content

Commit

Permalink
・_ConnectWebsiteでサイトへの接続後にSocketがブロッキング状態になっていたのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
amate committed Aug 14, 2018
1 parent c180f3a commit 573ed40
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Proxydomo/AppConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#endif

/// アプリケーションのバージョン
#define APP_VERSION _T("1.106")
#define APP_VERSION _T("1.107")



Expand Down
1 change: 1 addition & 0 deletions Proxydomo/RequestManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ void CRequestManager::_ConnectWebsite()
_AddTraceLog(L"Connection failed...");
return ;
}
sockWeb->SetBlocking(false);
m_psockWebsite = std::move(sockWeb);
_AddTraceLog(L"Connection success!");

Expand Down
4 changes: 4 additions & 0 deletions Proxydomo/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ int CSocket::Read(char* buffer, int length)
if (m_sock == 0)
return -1;

if (IsDataAvailable() == false) {
return 0;
}

ATLASSERT(length > 0);
int ret = ::recv(m_sock, buffer, length, 0);
if (ret == 0) { // disconnect
Expand Down

0 comments on commit 573ed40

Please sign in to comment.