File tree 3 files changed +10
-9
lines changed
3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ namespace Poco {
27
27
namespace Net {
28
28
29
29
30
- SocketReactor::SocketReactor ():
30
+ SocketReactor::SocketReactor (): _threadAffinity(- 1 ),
31
31
_stop (false ),
32
32
_pReadableNotification(new ReadableNotification(this )),
33
33
_pWritableNotification(new WritableNotification(this )),
@@ -86,6 +86,7 @@ void SocketReactor::run()
86
86
if (hasSocketHandlers ())
87
87
{
88
88
sm = _pollSet.poll (_params.pollTimeout );
89
+ if (_stop) break ;
89
90
for (const auto & s : sm)
90
91
{
91
92
try
@@ -167,7 +168,6 @@ void SocketReactor::stop()
167
168
168
169
void SocketReactor::wakeUp ()
169
170
{
170
- if (_stop) return ;
171
171
_pollSet.wakeUp ();
172
172
_event.set ();
173
173
}
Original file line number Diff line number Diff line change @@ -416,12 +416,14 @@ namespace
416
416
void onReadable (ReadableNotification* pNf)
417
417
{
418
418
pNf->release ();
419
- char buffer[64 ];
420
- do
419
+ std::vector<char > buffer;
420
+ int n = 0 ;
421
+ while ((n = _socket.available ()))
421
422
{
422
- if (0 == _socket.receiveBytes (&buffer[0 ], sizeof (buffer)))
423
- break ;
424
- } while (true );
423
+ if (n > buffer.size ()) buffer.resize (n);
424
+ n = _socket.receiveBytes (&buffer[0 ], buffer.size ());
425
+ if (0 == n) break ;
426
+ }
425
427
}
426
428
427
429
void onShutdown (ShutdownNotification* pNf)
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class CppUnit::TestCaller<class RawSocketTest>.testEchoIPv4Move
6
6
class CppUnit::TestCaller<class ICMPClientTest>.testPing
7
7
class CppUnit::TestCaller<class ICMPClientTest>.testBigPing
8
8
class CppUnit::TestCaller<class HTTPSClientSessionTest>.testProxy
9
- class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
9
+ class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
10
10
class CppUnit::TestCaller<class TCPServerTest>.testReuseSocket
11
11
class CppUnit::TestCaller<class HTTPSClientSessionTest>.testInterop
12
12
class CppUnit::TestCaller<class PathTest>.testFind
@@ -21,4 +21,3 @@ class CppUnit::TestCaller<class WinServiceTest>.testServiceReturnsTrueIfStopped
21
21
class CppUnit::TestCaller<class ICMPSocketTest>.testSendToReceiveFrom
22
22
class CppUnit::TestCaller<class ICMPSocketTest>.testMTU
23
23
class CppUnit::TestCaller<class HTTPSClientSessionTest>.testCachedSession
24
- class CppUnit::TestCaller<class PollSetTest>.testPollClosedServer
You can’t perform that action at this time.
0 commit comments