Added `toString`s for all the listeners.
This commit is contained in:
parent
9f565e9c09
commit
9c853b22c3
|
@ -27,6 +27,9 @@ public class BesterListener : Thread
|
||||||
/* Whether or not the listener is active */
|
/* Whether or not the listener is active */
|
||||||
private bool active = true;
|
private bool active = true;
|
||||||
|
|
||||||
|
/* the address of this listener */
|
||||||
|
protected Address address;
|
||||||
|
|
||||||
this(BesterServer besterServer)
|
this(BesterServer besterServer)
|
||||||
{
|
{
|
||||||
/* Set the function address to be called as the worker function */
|
/* Set the function address to be called as the worker function */
|
||||||
|
@ -43,6 +46,9 @@ public class BesterListener : Thread
|
||||||
{
|
{
|
||||||
/* Set the server socket */
|
/* Set the server socket */
|
||||||
this.serverSocket = serverSocket;
|
this.serverSocket = serverSocket;
|
||||||
|
|
||||||
|
/* Set the address */
|
||||||
|
address = serverSocket.localAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,6 +19,12 @@ public final class UNIXListener : BesterListener
|
||||||
unixSocket.bind(address);
|
unixSocket.bind(address);
|
||||||
return unixSocket;
|
return unixSocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override public string toString()
|
||||||
|
{
|
||||||
|
string address = "unix://"~super.address.toAddrString();
|
||||||
|
return address;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class TCP4Listener : BesterListener
|
public final class TCP4Listener : BesterListener
|
||||||
|
@ -35,6 +41,12 @@ public final class TCP4Listener : BesterListener
|
||||||
tcp4Socket.bind(address);
|
tcp4Socket.bind(address);
|
||||||
return tcp4Socket;
|
return tcp4Socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override public string toString()
|
||||||
|
{
|
||||||
|
string address = "tcp4://"~super.address.toAddrString();
|
||||||
|
return address;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class TCP6Listener : BesterListener
|
public final class TCP6Listener : BesterListener
|
||||||
|
@ -51,5 +63,11 @@ public final class TCP6Listener : BesterListener
|
||||||
tcp6Socket.bind(address);
|
tcp6Socket.bind(address);
|
||||||
return tcp6Socket;
|
return tcp6Socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override public string toString()
|
||||||
|
{
|
||||||
|
string address = "tcp6://"~super.address.toAddrString();
|
||||||
|
return address;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ public final class BesterInformerClient : Thread
|
||||||
for(ulong i = 0; i < server.listeners.length; i++)
|
for(ulong i = 0; i < server.listeners.length; i++)
|
||||||
{
|
{
|
||||||
JSONValue listener;
|
JSONValue listener;
|
||||||
listener["address"] = server.listeners[i].getServerSocket().localAddress().toAddrString();
|
listener["address"] = server.listeners[i].toString();
|
||||||
listenersBlock["listener"~to!(string)(i)] = listener;
|
listenersBlock["listener"~to!(string)(i)] = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue