Fix warnings

This commit is contained in:
Flamefire committed 2014-02-15 12:40:16 +01:00
1 parent f3c713416c
commit ff8fa48f3c
1 file changed
+8 -14
+8 -14
View File
@@ -1,5 +1,4 @@
using System; using System;
using System.Net.Sockets;
using System.ServiceModel; using System.ServiceModel;
using System.ServiceModel.Web; using System.ServiceModel.Web;
using System.Diagnostics; using System.Diagnostics;
@@ -93,11 +92,9 @@ namespace ServerLib
private void _Init(int port, bool encrypted) private void _Init(int port, bool encrypted)
{ {
string hostname = Dns.GetHostName(); string hostname = Dns.GetHostName();
if (encrypted) string protocol = (encrypted) ? "https" : "http";
_BaseAddress = new Uri("https://" + hostname + ":" + port + "/"); _BaseAddress = new Uri(protocol + "://" + hostname + ":" + port + "/");
else _Encrypted = encrypted;
_BaseAddress = new Uri("http://" + hostname + ":" + port + "/");
this._Encrypted = encrypted;
_Host = new WebServiceHost(typeof(CWebservice), _BaseAddress); _Host = new WebServiceHost(typeof(CWebservice), _BaseAddress);
WebHttpBinding wb = new WebHttpBinding WebHttpBinding wb = new WebHttpBinding
@@ -137,7 +134,7 @@ namespace ServerLib
_Init(_BaseAddress.Port, _Encrypted); _Init(_BaseAddress.Port, _Encrypted);
_Host.Open(); _Host.Open();
} }
catch (CommunicationException e2) catch (CommunicationException)
{ {
_Host.Abort(); _Host.Abort();
} }
@@ -153,7 +150,7 @@ namespace ServerLib
{ {
_Host.Close(); _Host.Close();
} }
catch (CommunicationException e) catch (CommunicationException)
{ {
_Host.Abort(); _Host.Abort();
} }
@@ -166,18 +163,15 @@ namespace ServerLib
ProcessStartInfo info = new ProcessStartInfo ProcessStartInfo info = new ProcessStartInfo
{ {
FileName = "VocaluxeServerConfig.exe", FileName = "VocaluxeServerConfig.exe",
Arguments = port.ToString() + " " + (_Encrypted ? "true" : "false"), Arguments = port + " " + (_Encrypted ? "true" : "false"),
UseShellExecute = true, UseShellExecute = true,
CreateNoWindow = true, CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden, WindowStyle = ProcessWindowStyle.Hidden,
Verb = "runas" Verb = "runas"
}; };
Process p = Process.Start(info); Process p = Process.Start(info);
if (p != null) p.WaitForExit();
{ p.Close();
p.WaitForExit();
p.Close();
}
#else #else