mirror of
https://github.com/deavminet/dnetd.git
synced 2025-02-17 21:17:46 +00: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 */
|
||||
DConnection connection = new DConnection(this, socket);
|
||||
|
||||
/* 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();
|
||||
addConnection(connection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,6 +135,25 @@ public class DServer : Thread
|
||||
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)
|
||||
{
|
||||
/* The channel */
|
||||
|
Loading…
Reference in New Issue
Block a user