[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [2854] Fixed a problem with the `DELETE_CONNECTION' re
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [2854] Fixed a problem with the `DELETE_CONNECTION' return status in `ClientsThread'. |
Date: |
Mon, 29 Sep 2008 22:31:51 +0000 |
Revision: 2854
http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2854
Author: gscrivano
Date: 2008-09-29 22:31:49 +0000 (Mon, 29 Sep 2008)
Log Message:
-----------
Fixed a problem with the `DELETE_CONNECTION' return status in `ClientsThread'.
Modified Paths:
--------------
trunk/myserver/include/server/server.h
trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
trunk/myserver/src/server/server.cpp
Modified: trunk/myserver/include/server/server.h
===================================================================
--- trunk/myserver/include/server/server.h 2008-09-29 10:26:12 UTC (rev
2853)
+++ trunk/myserver/include/server/server.h 2008-09-29 22:31:49 UTC (rev
2854)
@@ -150,6 +150,8 @@
ConnectionsScheduler* getConnectionsScheduler(){return
&connectionsScheduler;}
int deleteConnection(ConnectionPtr);
+ int notifyDeleteConnection(ConnectionPtr);
+
void increaseFreeThread();
void decreaseFreeThread();
Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
2008-09-29 10:26:12 UTC (rev 2853)
+++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
2008-09-29 22:31:49 UTC (rev 2854)
@@ -170,7 +170,8 @@
if(!connection->allowDelete())
return;
- server->deleteConnection(connection);
+ server->notifyDeleteConnection(connection);
+
removeConnection(connection);
}
else if(event == EV_READ)
Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp 2008-09-29 10:26:12 UTC (rev
2853)
+++ trunk/myserver/src/server/server.cpp 2008-09-29 22:31:49 UTC (rev
2854)
@@ -1482,11 +1482,24 @@
return newConnection;
}
+
+
/*!
- *Get notified when a connection is closed.
+ *Delete a connection.
*/
int Server::deleteConnection(ConnectionPtr s)
{
+ notifyDeleteConnection(s);
+ connectionsScheduler.removeConnection (s);
+
+ return 0;
+}
+
+/*!
+ *Get notified when a connection is closed.
+ */
+int Server::notifyDeleteConnection(ConnectionPtr s)
+{
string msg("remove-connection");
vector<Multicast<string, void*, int>*>* handlers;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [2854] Fixed a problem with the `DELETE_CONNECTION' return status in `ClientsThread'.,
Giuseppe Scrivano <=