mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-02 01:41:05 +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)
|
void onSocketReadable(const AutoPtr<ReadableNotification>& pNf)
|
||||||
{
|
{
|
||||||
// some socket implementations (windows) report available
|
int len = _socket.receiveBytes(_fifoIn);
|
||||||
// bytes on client disconnect, so we double-check here
|
if (len > 0)
|
||||||
if (_socket.available())
|
|
||||||
{
|
{
|
||||||
int len = _socket.receiveBytes(_fifoIn);
|
|
||||||
_fifoIn.drain(_fifoOut.write(_fifoIn.buffer(), _fifoIn.used()));
|
_fifoIn.drain(_fifoOut.write(_fifoIn.buffer(), _fifoIn.used()));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onSocketWritable(const AutoPtr<WritableNotification>& pNf)
|
void onSocketWritable(const AutoPtr<WritableNotification>& pNf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user