/// <summary> /// <c>motSocket</c> /// Socket used for writing and processing return valus uusing a BoolByteDelegate for return value processing /// </summary> /// <param name="targetAddress"></param> /// <param name="targetPort"></param> /// <param name="byteProtocolProcessor"></param> public MotSocket(string targetAddress, int targetPort, BoolByteDelegate byteProtocolProcessor = null) { Port = targetPort; Address = targetAddress; ByteArgProtocolProcessor = byteProtocolProcessor ?? DefaultProtocolProcessor; _openForListening = false; _eventLogger = LogManager.GetLogger("motCommonLib.Socket"); MotSetCertificate(); if (SocketMutex == null) { SocketMutex = new Mutex(); } OpenAsClient(); }
/// <summary> /// <c>motSocket</c> /// Socket used for writing with the option of enabling SSL and using a BoolByteDelegate for return value processing /// </summary> /// <param name="address"></param> /// <param name="port"></param> /// <param name="secureConnection"></param> /// <param name="byteProtocolProcessor"></param> public MotSocket(string address, int port, bool secureConnection, BoolByteDelegate byteProtocolProcessor = null) { Port = port; Address = address; ByteArgProtocolProcessor = byteProtocolProcessor ?? DefaultProtocolProcessor; UseSsl = secureConnection; _openForListening = false; _eventLogger = LogManager.GetLogger("motCommonLib.Socket"); MotSetCertificate(); if (SocketMutex == null) { SocketMutex = new Mutex(); } OpenAsClient(); }