mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 09:43:37 +02:00
44 lines
643 B
D
44 lines
643 B
D
/**
|
|
* dconnection
|
|
*
|
|
* Client/server connection handler spawned
|
|
* by socket connection dequeue loop.
|
|
*
|
|
* Handles all interactions between
|
|
* the server and the specific client/server.
|
|
*/
|
|
|
|
module dnetd.dconnection;
|
|
|
|
import core.thread : Thread;
|
|
import std.socket : Socket;
|
|
|
|
public class DConnection : Thread
|
|
{
|
|
/* The client's socket */
|
|
private Socket socket;
|
|
|
|
this(Socket socket)
|
|
{
|
|
/* Set the function to be called on thread start */
|
|
super(&worker);
|
|
|
|
/* Set the socket */
|
|
this.socket = socket;
|
|
|
|
/* Start the connection handler */
|
|
start();
|
|
}
|
|
|
|
/**
|
|
* Byte dequeue loop
|
|
*/
|
|
private void worker()
|
|
{
|
|
while(true)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|