return false;
int incoming = -1;
- bool n = true;
if ((fd < 0) || (fd > MAX_DESCRIPTORS))
return false;
return true;
break;
case I_CONNECTED:
-
- if (this->WaitingForWriteEvent)
- {
- /* Trigger the write event */
- n = this->OnWriteReady();
- }
- else
- {
- /* Process the read event */
- n = this->OnDataReady();
- }
- return n;
+ /* Process the read event */
+ return this->OnDataReady();
break;
default:
break;
this->Close();
}
-void InspSocket::HandleEvent(EventType et)
+void InspSocket::HandleEvent(EventType et, int errornum)
{
switch (et)
{
+ case EVENT_ERROR:
+ this->Instance->SE->DelFd(this);
+ this->Close();
+ delete this;
+ return;
+ break;
case EVENT_READ:
if (!this->Poll())
{
case EVENT_WRITE:
if (this->WaitingForWriteEvent)
{
+ this->WaitingForWriteEvent = false;
if (!this->OnWriteReady())
{
this->Instance->SE->DelFd(this);
}
else
{
+ Instance->Log(DEBUG,"State=%d CONNECTED=%d", this->state, I_CONNECTED);
if (this->FlushWriteBuffer())
{
this->Instance->SE->DelFd(this);