1
0
mirror of https://github.com/deavminet/dnetd synced 2024-09-21 09:43:37 +02:00

Set bind details, address type, sock flow type and protocol typep

This commit is contained in:
Tristan 🅱. Kildaire 2020-09-23 21:49:56 +02:00
parent e2b0ec0846
commit c031db0ca2

View File

@ -11,7 +11,7 @@
module dnetd.dserver; module dnetd.dserver;
import core.thread : Thread; import core.thread : Thread;
import std.socket : Address, Socket; import std.socket : Address, Socket, AddressFamily, SocketType, ProtocolType;
import dnetd.dconnection; import dnetd.dconnection;
import dnetd.dchannel; import dnetd.dchannel;
import std.string : cmp; import std.string : cmp;
@ -71,7 +71,7 @@ public class DServer : Thread
private void initNetwork() private void initNetwork()
{ {
/* Create the socket */ /* Create the socket */
serverSocket = new Socket(); serverSocket = new Socket(AddressFamily.INET, SocketType.STREAM, ProtocolType.TCP);
/* Bind the socket to the given address */ /* Bind the socket to the given address */
serverSocket.bind(sockAddress); serverSocket.bind(sockAddress);