Hello, how can I write a network client that could set an event for an action. For example:
void main() { MyClient client=new MyClient() client.receive+=my_receive; client.Start(9274); } void my_receive(byte[] data) { Console.WriteLine(Encoding.UTF8.getString(data)); }
Simply, all the examples that I found, TCPClient razluyut with sending only one message. and immediately thereafter closed