Strange behavior of System.Web.Sockets receiving info from socket RRS feed

  • Question

  • I have a code that use TCP connection to obtain data from server with two interfaces: binary and JSON. It works pretty fast and, what is logical, getting binary data is greatly faster than JSON. But it is true only when client is running at the same host with server using localhost roundtrip. When I use remote connection to server, JSON interface is getting faster than binary. As you can see at attached picture, profiling of the same client apps with different connection strings (remote - left part and local - right part of the picture) shows one strange thing: I have a 80% (4166ms from total 5106ms running binary reader method 'ReadAll') of all running time delay at calling something secret at ntdll.dll. Any ideas, what it can be? 

    Thursday, January 10, 2019 4:33 PM

All replies

  • Network delays are not consistent and not predictable.  If you ran this a dozen times, you'd get a dozen different results.  Total transit time will be shorter if the payload is significantly shorter, but the network delays will almost always swamp that.

    I don't see any network activity in the right-hand part of the image.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Thursday, January 10, 2019 6:13 PM