Bugfix
This commit is contained in:
@@ -27,11 +27,14 @@ namespace ErgometerLibrary
|
|||||||
client.GetStream().Flush();
|
client.GetStream().Flush();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (client.Connected)
|
||||||
|
{
|
||||||
StreamWriter wr = new StreamWriter(client.GetStream(), Encoding.Unicode);
|
StreamWriter wr = new StreamWriter(client.GetStream(), Encoding.Unicode);
|
||||||
wr.WriteLine(command);
|
wr.WriteLine(command);
|
||||||
Console.WriteLine("sent " + command);
|
Console.WriteLine("sent " + command);
|
||||||
wr.Flush();
|
wr.Flush();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static NetCommand ReadNetCommand(TcpClient client)
|
public static NetCommand ReadNetCommand(TcpClient client)
|
||||||
{
|
{
|
||||||
@@ -56,12 +59,14 @@ namespace ErgometerLibrary
|
|||||||
string response = Encoding.Unicode.GetString(bytesFrom);
|
string response = Encoding.Unicode.GetString(bytesFrom);
|
||||||
return response;
|
return response;
|
||||||
*/
|
*/
|
||||||
|
if (client.Connected)
|
||||||
|
{
|
||||||
StreamReader rd = new StreamReader(client.GetStream(), Encoding.Unicode);
|
StreamReader rd = new StreamReader(client.GetStream(), Encoding.Unicode);
|
||||||
string str = rd.ReadLine();
|
string str = rd.ReadLine();
|
||||||
Console.WriteLine("rec " + str);
|
Console.WriteLine("rec " + str);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static IPAddress GetIP(string ipstring)
|
public static IPAddress GetIP(string ipstring)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user