mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 09:43:37 +02:00
Migrated connectionQueue addition code to addConnection()
This commit is contained in:
parent
5983f090e3
commit
c7fd5a6d30
@ -117,15 +117,8 @@ public class DServer : Thread
|
|||||||
/* Spawn a connection handler */
|
/* Spawn a connection handler */
|
||||||
DConnection connection = new DConnection(this, socket);
|
DConnection connection = new DConnection(this, socket);
|
||||||
|
|
||||||
/* Lock the connections list */
|
|
||||||
connectionLock.lock();
|
|
||||||
|
|
||||||
/* Add to the connection queue */
|
/* Add to the connection queue */
|
||||||
connectionQueue ~= connection;
|
addConnection(connection);
|
||||||
writeln("Added new connection to queue "~to!(string)(connection));
|
|
||||||
|
|
||||||
/* Unlock the connections list */
|
|
||||||
connectionLock.unlock();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,6 +135,25 @@ public class DServer : Thread
|
|||||||
channelLock.unlock();
|
channelLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addConnection(DConnection connection)
|
||||||
|
{
|
||||||
|
/* Lock the connections list */
|
||||||
|
connectionLock.lock();
|
||||||
|
|
||||||
|
/* Add to the connection queue */
|
||||||
|
connectionQueue ~= connection;
|
||||||
|
writeln("Added new connection to queue "~to!(string)(connection));
|
||||||
|
|
||||||
|
/* Unlock the connections list */
|
||||||
|
connectionLock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO Remove connection */
|
||||||
|
public void removeConnection(DConnection client)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public DChannel getChannelByName(string channelName)
|
public DChannel getChannelByName(string channelName)
|
||||||
{
|
{
|
||||||
/* The channel */
|
/* The channel */
|
||||||
|
Loading…
Reference in New Issue
Block a user