The situation is like this:
- I have a WCF host with a duplex nettcpbinding
- I have a WCF client that asks for an object which contains a byte array (an image of approximately 2MB)
- I get this object (server side) using the entity framework from my database and it is something like this:
- id (int)
- type (string)
- data (byte[] of approx 2MB)
- I then return it to the client (actually to the .NET wcf code, where it should get serialized and then sent to the client), and from then on I can't debug any further and my code seems to have returned fine in the server, but my client keeps waiting for 15 seconds or more until it gets a reply from the service host.
My cpu uses 100% of a core (used by the application that hosts the service), so it's busy with doing something between my return and sending it. I'm sure it's not the sending that's taking so long, because my reliable session starts to ask for retransmissions, since it's not receiving anything, making it even worse... So i turned off the reliable session, what caused the service only having to reply once to my request :), but 15 bloody seconds for 2MB of data...
When i have no data (so null for the data part), it works fine. The larger the image gets, the longer it takes... And the strangest thing is that it sometimes goes very fast (1 second or something like that (but that doesn't happen much and it seems to be random). This happens on all computers I've tested, so nothing to do with my PC.