void Connect(string nodeAddress, ushort port = 8333)
{
// Connect to remote host
try
{
Console.WriteLine("Connecting to: " + nodeAddress);
mSocket.Connect(nodeAddress, port);
//IAsyncResult connAsync = mSocket.BeginConnect(nodeAddress, port, null, null);
//bool success = connAsync.AsyncWaitHandle.WaitOne(3000, true);
//if (success)
//{
Console.WriteLine("connected to: " + nodeAddress);
// Start the read thread
mThread.Start();
// Send version packet
SendVersionPacket();
//}
//else
//{
// Console.WriteLine("connnection timeout");
//}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}