You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I'm trying to understand how the library works.
I wrote the following client code replacing the Client in TcpAsync:
public static async Task Client2()
{
try
{
using (System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient())
{
client.Connect(Default.IPEndPoint);
var st = client.GetStream();
using (BinaryWriter writer = new BinaryWriter(st))
using (BinaryReader reader = new BinaryReader(st))
{
writer.Write("Hello ");
writer.Flush();
writer.Write(true);
writer.Flush();
writer.Write(" good to go");
string s = reader.ReadString();
Console.Write(s);
}
}
}
catch (Exception e)
{
Console.WriteLine("Client Exception:");
Console.WriteLine(e);
}
}
Well, the server never returns from AcceptAsync().
I'm familiar with socket programming, but not this.
Is this implementation somehow bound to use strings or something? I mean, shouldn't I be able to read the bytes sent by the client?
Thanks!
The text was updated successfully, but these errors were encountered:
All I did was to modify your TcpAsync.cs example, adding my client code as above instead of the Client(). That's all. Just copy/paste this client code in your example and invoke it on Main.
Hi there,
I'm trying to understand how the library works.
I wrote the following client code replacing the Client in TcpAsync:
Well, the server never returns from AcceptAsync().
I'm familiar with socket programming, but not this.
Is this implementation somehow bound to use strings or something? I mean, shouldn't I be able to read the bytes sent by the client?
Thanks!
The text was updated successfully, but these errors were encountered: