LiveOrDevTrying / Tcp.NET

Tcp.NET provides an easy-to-use and customizable Tcp Server and Tcp Client. The server is created using a TcpListener. The server and client can be used for non-SSL or SSL connections and authentication (including client and server ssl certification validation) is provided for identifying the clients connected to your server. Both client and server are created in .NET Standard and use async await functionality.
Apache License 2.0
41 stars 10 forks source link

I do not receive messages #12

Open cla78 opened 4 weeks ago

cla78 commented 4 weeks ago

Hi, I tried your tcp server, setting it up as explained.

internal class Program
    {
        static void Main(string[] args)
        {
              Console.WriteLine("Server Started...!");

            TcpNETServer server = new TcpNETServer(new ParamsTcpServer(8989, "\r\n", "Connected Successfully"));
            server.MessageEvent += Server_MessageEvent;

            server.StartAsync();

            Console.ReadKey();
        }

        private static void Server_MessageEvent(object sender, Tcp.NET.Server.Events.Args.TcpMessageServerEventArgs args)
        {
        }
    }

I connect with Hercules but receive no message , Could you help me understand what's wrong?

Thanks

Sundarkdk commented 3 weeks ago

Hi cla78 all messages received by the server have to end with "EndOfLine" espcified in ParamsTcpServer, in this case with "\r\n".

cla78 commented 3 weeks ago

I do not know what I am doing wrong. The project is in net core 8 on console application and topshelf. Even if I put the end-of-line characters at each send, I get nothing. Connection, disconnection, error, boot/stop events are triggered but never the message event.

I attach a short video. Video and iimplementation.zip

Thanks, Claudio

Sundarkdk commented 3 weeks ago

Hi Claudio, your code is ok, is hercules. try send messages in hercules with ends < "CR"><"LF">, example: Hello world<"CR"><"LF">. Use it without "".

cla78 commented 3 weeks ago

Hi, I changed the testsoftware by replacing Hercules with AutoID Terminal and now it works.

Thank you for your helpfulness and sorry for wasting your time.