public void DisconnectThread() {
IsReady = false;
AssignBotForInputParsing();
isConnected = false;
if ( thread != null && thread.IsAlive ) {
thread.Join( 1000 );
if ( thread.IsAlive ) {
thread.Abort();
}
}
try {
if ( reader != null )
reader.Close();
} catch ( ObjectDisposedException ) { }
try {
if ( writer != null )
writer.Close();
} catch ( ObjectDisposedException ) { }
try {
if ( client != null )
client.Close();
} catch ( ObjectDisposedException ) { }
}