pull/1/head
Ogoun 5 years ago
parent a064b5972d
commit 9e6cc90656

@ -25,11 +25,18 @@ namespace ZeroLevel.Network
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, false);
try
{
socket.Connect(endpoint);
socket.Shutdown(SocketShutdown.Both);
socket.Close();
IAsyncResult result = socket.BeginConnect(endpoint, null, null);
bool success = result.AsyncWaitHandle.WaitOne(100, true);
if (socket.Connected)
{
socket.EndConnect(result);
return true;
}
else
{
socket.Close();
}
}
catch
{
}

@ -42,7 +42,15 @@ namespace ZeroLevel.Services.Shedulling
}
if (result != null)
{
Task.Run(() => result.Callback(result.Key)).ContinueWith(t =>
try
{
result.Callback(result.Key);
}
catch (Exception ex)
{
Log.SystemError(ex, $"Fault task '{result.Key}' on expiration date '{result.ExpirationDate.ToString("yyyy-MM-dd HH:mm:ss fff}")}'");
}
/*Task.Run(() => result.Callback(result.Key)).ContinueWith(t =>
{
if (t.IsFaulted)
{
@ -51,7 +59,7 @@ namespace ZeroLevel.Services.Shedulling
ex = ex.InnerException;
Log.SystemError(ex, $"Fault task '{result.Key}' on expiration date '{result.ExpirationDate.ToString("yyyy-MM-dd HH:mm:ss fff}")}'");
}
});
});*/
}
}

@ -16,14 +16,23 @@
<RepositoryType>GitHub</RepositoryType>
<Version>3.0.9</Version>
<FileVersion>3.0.0.9</FileVersion>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
</Project>

Loading…
Cancel
Save

Powered by TurnKey Linux.