public static void SetPrimarySocket(NetWorker netWorker) { PrimarySocket = netWorker; if (PrimarySocket is CrossPlatformUDP) PrimaryProtocolType = ProtocolType.UDP; else PrimaryProtocolType = ProtocolType.TCP; }