mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-31 07:58:24 +02:00
fixed bad disconnect handling in onSocketReadable
This commit is contained in:
parent
cdb2195ed3
commit
9b10c24b61
@ -111,13 +111,15 @@ public:
|
||||
|
||||
void onSocketReadable(const AutoPtr<ReadableNotification>& pNf)
|
||||
{
|
||||
// some socket implementations (windows) report available
|
||||
// bytes on client disconnect, so we double-check here
|
||||
if (_socket.available())
|
||||
int len = _socket.receiveBytes(_fifoIn);
|
||||
if (len > 0)
|
||||
{
|
||||
int len = _socket.receiveBytes(_fifoIn);
|
||||
_fifoIn.drain(_fifoOut.write(_fifoIn.buffer(), _fifoIn.used()));
|
||||
}
|
||||
else
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
void onSocketWritable(const AutoPtr<WritableNotification>& pNf)
|
||||
|
Loading…
x
Reference in New Issue
Block a user