public bool Connect()
{
if (this.socket == null)
this.socket = CreateSocketByUri(uri);
this.opened = true;
if (!this.socket.IsClosed)
{
if (OnOpen != null)
OnOpen(this, null);
ThreadPool.QueueUserWorkItem(ProcessMessages);
}
return !this.socket.IsClosed;
}