mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 00:22:40 +01:00
Merge pull request #87 from Cyberboss/rcfix
Some Interop Listener fixes
This commit is contained in:
@@ -407,7 +407,10 @@ namespace TGServerService
|
||||
try
|
||||
{
|
||||
error = null;
|
||||
return Convert.ToUInt16(File.ReadAllText(InteropConfig));
|
||||
lock (configLock)
|
||||
{
|
||||
return Convert.ToUInt16(File.ReadAllText(InteropConfig));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -221,16 +221,17 @@ namespace TGServerService
|
||||
{
|
||||
try
|
||||
{
|
||||
var handler = listener.EndAccept(asyncResult);
|
||||
using (var handler = listener.EndAccept(asyncResult))
|
||||
{
|
||||
|
||||
var bytes = new byte[1024];
|
||||
int bytesRec = handler.Receive(bytes);
|
||||
// Show the data on the console.
|
||||
HandleCommand(Encoding.ASCII.GetString(bytes, 0, bytesRec));
|
||||
|
||||
handler.Shutdown(SocketShutdown.Both);
|
||||
handler.Close();
|
||||
clientConnected.Set();
|
||||
var bytes = new byte[1024];
|
||||
int bytesRec = handler.Receive(bytes);
|
||||
// Show the data on the console.
|
||||
HandleCommand(Encoding.ASCII.GetString(bytes, 0, bytesRec));
|
||||
|
||||
handler.Close();
|
||||
clientConnected.Set();
|
||||
}
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{ }
|
||||
|
||||
Reference in New Issue
Block a user