mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-17 20:58:11 +00:00
Refactoring MtApi
This commit is contained in:
@@ -100,7 +100,7 @@ namespace MTApiService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var coonected = false;
|
bool coonected;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -254,13 +254,7 @@ namespace MTApiService
|
|||||||
public string Host { get; private set; }
|
public string Host { get; private set; }
|
||||||
public int Port { get; private set; }
|
public int Port { get; private set; }
|
||||||
|
|
||||||
private bool IsConnected
|
private bool IsConnected => _proxy.State == CommunicationState.Opened;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _proxy.State == CommunicationState.Opened;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace MTApiService
|
|||||||
|
|
||||||
Log.DebugFormat("SendTask: begin. command = {0}", command);
|
Log.DebugFormat("SendTask: begin. command = {0}", command);
|
||||||
|
|
||||||
ITaskExecutor executor = null;
|
ITaskExecutor executor;
|
||||||
|
|
||||||
lock (_locker)
|
lock (_locker)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ namespace MTApiService
|
|||||||
Log.Debug("DequeueTask: called.");
|
Log.Debug("DequeueTask: called.");
|
||||||
|
|
||||||
MtCommandTask task;
|
MtCommandTask task;
|
||||||
int count = 0;
|
int count;
|
||||||
|
|
||||||
lock (_locker)
|
lock (_locker)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1780,7 +1780,7 @@ namespace MtApi
|
|||||||
|
|
||||||
private void Disconnect(bool failed)
|
private void Disconnect(bool failed)
|
||||||
{
|
{
|
||||||
var state = failed ? MtConnectionState.Disconnected : MtConnectionState.Disconnected;
|
var state = failed ? MtConnectionState.Failed : MtConnectionState.Disconnected;
|
||||||
var message = failed ? "Connection Failed" : "Disconnected";
|
var message = failed ? "Connection Failed" : "Disconnected";
|
||||||
|
|
||||||
lock (_locker)
|
lock (_locker)
|
||||||
|
|||||||
Reference in New Issue
Block a user