mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
This commit is contained in:
parent
9f4b1b7df4
commit
b0dc9c5a82
@ -27,7 +27,7 @@ namespace Poco {
|
||||
namespace Net {
|
||||
|
||||
|
||||
SocketReactor::SocketReactor():
|
||||
SocketReactor::SocketReactor(): _threadAffinity(-1),
|
||||
_stop(false),
|
||||
_pReadableNotification(new ReadableNotification(this)),
|
||||
_pWritableNotification(new WritableNotification(this)),
|
||||
@ -86,6 +86,7 @@ void SocketReactor::run()
|
||||
if (hasSocketHandlers())
|
||||
{
|
||||
sm = _pollSet.poll(_params.pollTimeout);
|
||||
if (_stop) break;
|
||||
for (const auto& s : sm)
|
||||
{
|
||||
try
|
||||
@ -167,7 +168,6 @@ void SocketReactor::stop()
|
||||
|
||||
void SocketReactor::wakeUp()
|
||||
{
|
||||
if (_stop) return;
|
||||
_pollSet.wakeUp();
|
||||
_event.set();
|
||||
}
|
||||
|
@ -416,12 +416,14 @@ namespace
|
||||
void onReadable(ReadableNotification* pNf)
|
||||
{
|
||||
pNf->release();
|
||||
char buffer[64];
|
||||
do
|
||||
std::vector<char> buffer;
|
||||
int n = 0;
|
||||
while ((n = _socket.available()))
|
||||
{
|
||||
if (0 == _socket.receiveBytes(&buffer[0], sizeof(buffer)))
|
||||
break;
|
||||
} while (true);
|
||||
if (n > buffer.size()) buffer.resize(n);
|
||||
n = _socket.receiveBytes(&buffer[0], buffer.size());
|
||||
if (0 == n) break;
|
||||
}
|
||||
}
|
||||
|
||||
void onShutdown(ShutdownNotification* pNf)
|
||||
|
@ -6,7 +6,7 @@ class CppUnit::TestCaller<class RawSocketTest>.testEchoIPv4Move
|
||||
class CppUnit::TestCaller<class ICMPClientTest>.testPing
|
||||
class CppUnit::TestCaller<class ICMPClientTest>.testBigPing
|
||||
class CppUnit::TestCaller<class HTTPSClientSessionTest>.testProxy
|
||||
class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
|
||||
class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
|
||||
class CppUnit::TestCaller<class TCPServerTest>.testReuseSocket
|
||||
class CppUnit::TestCaller<class HTTPSClientSessionTest>.testInterop
|
||||
class CppUnit::TestCaller<class PathTest>.testFind
|
||||
@ -21,4 +21,3 @@ class CppUnit::TestCaller<class WinServiceTest>.testServiceReturnsTrueIfStopped
|
||||
class CppUnit::TestCaller<class ICMPSocketTest>.testSendToReceiveFrom
|
||||
class CppUnit::TestCaller<class ICMPSocketTest>.testMTU
|
||||
class CppUnit::TestCaller<class HTTPSClientSessionTest>.testCachedSession
|
||||
class CppUnit::TestCaller<class PollSetTest>.testPollClosedServer
|
||||
|
Loading…
Reference in New Issue
Block a user