mirror of https://github.com/deavminet/dnetd-ng
Added missing Server instance to all Connection sub-classes
This commit is contained in:
parent
093211f7f9
commit
b6d84cfa92
|
@ -4,6 +4,7 @@
|
|||
module dnetd.connection.connection;
|
||||
|
||||
import core.thread : Thread;
|
||||
import dnetd.server : Server;
|
||||
|
||||
/**
|
||||
* Represents a client's/server's connection to
|
||||
|
@ -14,9 +15,16 @@ import core.thread : Thread;
|
|||
*/
|
||||
public abstract class Connection : Thread
|
||||
{
|
||||
this()
|
||||
/**
|
||||
* The server instance this Connection
|
||||
* is associated with
|
||||
*/
|
||||
private Server server;
|
||||
|
||||
this(Server server)
|
||||
{
|
||||
super(&handler);
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
import dnetd.connection.connection : Connection;
|
||||
import std.socket;
|
||||
import dnetd.server : Server;
|
||||
|
||||
/**
|
||||
* FIXME: When we do anything so far, I am assuming
|
||||
|
@ -12,11 +13,12 @@ import std.socket;
|
|||
*/
|
||||
public final class SocketConnection : Connection
|
||||
{
|
||||
private Socket clientSock;
|
||||
private Socket socket;
|
||||
|
||||
this(Socket socket)
|
||||
this(Server server, Socket socket)
|
||||
{
|
||||
clientSock = socket;
|
||||
super(server);
|
||||
this.socket = socket;
|
||||
}
|
||||
|
||||
public override void handler()
|
||||
|
|
Loading…
Reference in New Issue