public override void Start(Socket ClientSocket) { _ChannelSocket = ClientSocket; ReceiveEventArgs.AcceptSocket = _ChannelSocket; _StreamSSL.Initialize(_Certificate); StartReceive(); }
public bool Start() { var result = _ChannelSocket.BeginConnect(_Settings.Host, _Settings.Port, null, null); var success = result.AsyncWaitHandle.WaitOne(TimeSpan.FromMilliseconds(_Settings.ConnectTimeout)); _ChannelSocket.EndConnect(result); if (!success) { Close(); return(false); } _StreamSSL.Initialize("localhost"); StartReceive(); return(success); }