示例#1
0
		public static DcmSocket Create(DcmSocketType type) {
			if (type == DcmSocketType.TLS)
				return new DcmTlsSocket();
			else if (type == DcmSocketType.TCP)
				return new DcmTcpSocket();
			else if (type == DcmSocketType.ISCL)
				return null;
			else
				return null;
		}
示例#2
0
 public static DcmSocket Create(DcmSocketType type)
 {
     if (type == DcmSocketType.TLS)
     {
         return(new DcmTlsSocket());
     }
     else if (type == DcmSocketType.TCP)
     {
         return(new DcmTcpSocket());
     }
     else if (type == DcmSocketType.ISCL)
     {
         return(null);
     }
     else
     {
         return(null);
     }
 }
示例#3
0
        public static DcmSocket Create(DcmSocketType type)
        {
#if SILVERLIGHT
            return(type == DcmSocketType.TCP ? new DcmTcpSocket() : null);
#else
            if (type == DcmSocketType.TLS)
            {
                return(new DcmTlsSocket());
            }
            else if (type == DcmSocketType.TCP)
            {
                return(new DcmTcpSocket());
            }
            else if (type == DcmSocketType.ISCL)
            {
                return(null);
            }
            else
            {
                return(null);
            }
#endif
        }
示例#4
0
 public void Connect(string host, int port, DcmSocketType type)
 {
     _host = host;
     _port = port;
     _socketType = type;
     _stop = false;
     _isRunning = true;
     _thread = new Thread(Connect);
     _thread.IsBackground = true;
     _thread.Start();
 }
示例#5
0
文件: DcmServer.cs 项目: gogorrr/mdcm
 public void AddPort(int port, DcmSocketType type)
 {
     _ports.Add(port);
     _types.Add(type);
 }
示例#6
0
 public static DcmSocket Create(DcmSocketType type)
 {
     #if SILVERLIGHT
     return type == DcmSocketType.TCP ? new DcmTcpSocket() : null;
     #else
     if (type == DcmSocketType.TLS)
         return new DcmTlsSocket();
     else if (type == DcmSocketType.TCP)
         return new DcmTcpSocket();
     else if (type == DcmSocketType.ISCL)
         return null;
     else
         return null;
     #endif
 }