SuperSocket.ClientEngine icon indicating copy to clipboard operation
SuperSocket.ClientEngine copied to clipboard

EasyClient await cannot receive msg from server

Open sasukevita opened this issue 9 years ago • 12 comments

//tested EasyClient is running in Windows

//when AppServer is from Windows await client.ConnectAsync(new DnsEndPoint("185.120.5.51", 2012)); // ok client.ConnectAsync(new DnsEndPoint("185.120.5.51", 2012)).Wait() // ok

//when AppServer is from Linux await client.ConnectAsync(new DnsEndPoint("185.120.5.51", 2012)); // client not receive any message from server client.ConnectAsync(new DnsEndPoint("185.120.5.51", 2012)).Wait() // ok

//accessing AppServer is from Linux using windows telnet client is no problem, windows telnet client can receive message from AppServer

sasukevita avatar Nov 06 '16 14:11 sasukevita

It looks weird.

kerryjiang avatar Nov 18 '16 05:11 kerryjiang

I'm having exactly the same issue.

mvacha avatar Feb 07 '17 02:02 mvacha

In both ways, the connection always can be established? Just the message cannot be received in one case?

kerryjiang avatar Feb 07 '17 08:02 kerryjiang

When I look into WireShark, all the requests and responses are there. But EasyClient does not fire the Connected event or ResolvePackage method in the ReceiveFilter. Easier way to reproduce this issue is running the HttpTest from Test folder, it just never returns.

mvacha avatar Feb 07 '17 09:02 mvacha

Also I'm getting ArgumentOutOfRange exception in OnSessionDataReceived -> ArraySegment constructor exception

mvacha avatar Feb 07 '17 17:02 mvacha

Thanks for the information, I'll check this issue today!

kerryjiang avatar Feb 07 '17 19:02 kerryjiang

The issue locates in the SuperSocket.ProtoBase, I need debug into it.

kerryjiang avatar Feb 08 '17 17:02 kerryjiang

Any luck? Or if you can point me to a more specific location in ProtoBase, I can also try to debugg it and send you a pull request after.

mvacha avatar Feb 15 '17 10:02 mvacha

I would like to add that I have not had any luck with EasyClient (even used on different projects). Both AppServer and EasyClient are on Windows and able to connect to each other. AppServer is working perfectly and able to receive everything sent by EasyClient. However EasyClient doesn't respond to anything sent back by AppServer. Examination with WireShark confirms that all requests and responses are transmitted successfully. EasyClient's NewPackageReceived event never fires.

In some rather rare cases during debugging, EasyClient's NewPackageReceived event fires and work as expected but it doesn't work again the subsequent debug session and I have no idea how to reproduce that.

I have better luck with AsyncTcpSession but I'm really hoping that I could use EasyClient.

DamienLaw avatar Feb 26 '17 10:02 DamienLaw

OK, could you write a test case to produce the issue?

kerryjiang avatar Feb 27 '17 04:02 kerryjiang

Hello @mvacha, I have made the HttpTest works now.

You better create your own test cases to produce your issues and commit your code in github, then I can investigate the issues easily.

kerryjiang avatar Mar 08 '17 08:03 kerryjiang

Awesome, I'll think of some easy and reproducible way how to recreate it (I discovered it when trying to connect to TCP port inside a private network) and I'll add it to the Tests.

mvacha avatar Mar 09 '17 10:03 mvacha