mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-16 12:06:55 +02:00
add timeouts to requests to the json api
This commit is contained in:
parent
5447c01e1f
commit
afa1b8cb2d
1 changed files with 7 additions and 0 deletions
|
@ -187,6 +187,7 @@ namespace WinUI
|
|||
|
||||
request.Method = "GET";
|
||||
request.ContentType = "application/json";
|
||||
request.Timeout = 2000;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -232,6 +233,7 @@ namespace WinUI
|
|||
|
||||
request.Method = "POST";
|
||||
request.ContentType = "applicaiton/json";
|
||||
request.Timeout = 2000;
|
||||
|
||||
using (var streamWriter = new StreamWriter(((HttpWebRequest)request).GetRequestStream()))
|
||||
{
|
||||
|
@ -271,6 +273,7 @@ namespace WinUI
|
|||
}
|
||||
|
||||
request.Method = "DELETE";
|
||||
request.Timeout = 2000;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -289,6 +292,10 @@ namespace WinUI
|
|||
{
|
||||
MessageBox.Show("Error Leaving Network: Cannot connect to ZeroTier service.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Error leaving network: Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void PeersCallback(List<ZeroTierPeer> peers);
|
||||
|
|
Loading…
Add table
Reference in a new issue