Add Interface for a port field for Transports so that it is easier to set
we should add an interface to set the port, this will maker it easier for users to cast the transport and then set the port
public interface IPortTransport
{
public ushort Port { get; set; }
}
It'd be best to do this after we split the transports, and make sure to inform transport creators about this interface so they added it if needed.
so each transport decides if it wants to implement this interface or not right?
+1
so each transport decides if it wants to implement this interface or not right?
yes, so telepathy would implement this, but steam transport (I think) wouldn't
eg
public class TelepathyTransport : Transport, IPortTransport
if (Transport.activeTrasnport is IPortTransport portTransport)
{
portTransport.Port = 8000;
}
Is there a transport template people use when creating them, so they know what to add.
then this is a good idea.
Is there a transport template people use when creating them, so they know what to add.
Not that I am aware of, Mostly you just have to override the methods (although there are a few unwritten things like invoke callbacks on main thread. We are splitting the transports into server/client soon so we could maybe have a template then.