kerryjiang / SuperSocket.ClientEngine

A .NET library which can make your socket client development easier
366 stars 197 forks source link

EasyClient await cannot receive msg from server #47

Open sasukevita opened 8 years ago

sasukevita commented 8 years ago

//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

kerryjiang commented 8 years ago

It looks weird.

mvacha commented 7 years ago

I'm having exactly the same issue.

kerryjiang commented 7 years ago

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

mvacha commented 7 years ago

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 commented 7 years ago

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

kerryjiang commented 7 years ago

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

kerryjiang commented 7 years ago

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

mvacha commented 7 years ago

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.

DamienLaw commented 7 years ago

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.

kerryjiang commented 7 years ago

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

kerryjiang commented 7 years ago

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.

mvacha commented 7 years ago

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.