Very odd socket problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi group.

I've developed a client server application in c# 2003 (framework 1.1) for a
big customer. Since a few month we have a few very strange problems.

The server runs on srv 2003, but the problem also occurs on a xp machine.

We are connected to another server al the time. At undefined moments we do
not receive any data on the socket anymore, but we still can send. We
attached a sniffer to the network and saw that the other server still was
sending data and the packets are acknowledged.

Another problem with the same application: when we have 2 clients connected
and connect a third one everything goes well. But when the client disconnects
the 1st connected client has the same problem as the server2server
connecting. I debugged the code and saw that the server still (tries to) send
information to the client.

Everything the client sends is received and processed well.

I'm a but stuck now, because I receive no exceptions at all on the socket
components.

Maybe someone has some experience with this?

TIA,

Ed
 
Hi Vadym,

Tnx for responding.

I'm using synchronious socket.receive in a thread on both sides.

Concerning the possible application fault (yes, I'm also human ;-) I
debugged the application several times and the data is send... also checked
if the thread is not killed by writing regulary in the log and it is still
running.

Even on the net I can see the data on my sniffer. It just doesn't come out
of the socket.

What's even more odd is that after another client disconnects all the other
sessions look ok, still receiving data, but the 1st is not sending anymore
(but i'm doing a socket.send on that one) and no exceptions at all. Also
using nodelay, so there's no timeout involved also.

Regards,

Ed
 
Sometimes in these cases it is helpful to remove as many variables as
possible. I might:
1) Take two clients and server and stick them on a known-working 4 or 8 port
hub. Run your tests. If still issues, NetMon and diag. Make sure the
replies are going to the correct IP and MAC - they should be, but just
thinking of weird issues.
2) If you can prove via NetMon, that replies are sent but your client still
does not receive, then that is weird. Set socket timeouts to large values
and step debug at points you Know you should be getting data on a Receive.
3) If still no joy, replace the NICs and install newest drivers for nic.
Don't use cheap nics and drivers.
4) If still no joy, try different clients with a fresh xp install on install
of your software. If same thing, then probably not a network or hardware
issue - so problem must be your protocol or software issue.

Can you post a small, but complete, client and server that will demonstrate
this issue. This can be hard, but most times you can spot the issue by
starting again with a demo program.

--
William Stacey [MVP]

| Hi Vadym,
|
| Tnx for responding.
|
| I'm using synchronious socket.receive in a thread on both sides.
|
| Concerning the possible application fault (yes, I'm also human ;-) I
| debugged the application several times and the data is send... also
checked
| if the thread is not killed by writing regulary in the log and it is still
| running.
|
| Even on the net I can see the data on my sniffer. It just doesn't come out
| of the socket.
|
| What's even more odd is that after another client disconnects all the
other
| sessions look ok, still receiving data, but the 1st is not sending anymore
| (but i'm doing a socket.send on that one) and no exceptions at all. Also
| using nodelay, so there's no timeout involved also.
|
| Regards,
|
| Ed
|
| "Vadym Stetsyak" wrote:
|
| > Hello, Ed!
| >
| > EC> I've developed a client server application in c# 2003 (framework
1.1)
| > EC> for a big customer. Since a few month we have a few very strange
| > EC> problems.
| >
| > EC> The server runs on srv 2003, but the problem also occurs on a xp
| > EC> machine.
| >
| > EC> We are connected to another server al the time. At undefined
moments we
| > EC> do not receive any data on the socket anymore, but we still can
send.
| > EC> We attached a sniffer to the network and saw that the other server
| > EC> still was sending data and the packets are acknowledged.
| >
| > How do you receive data via synchronous Socket.Receive or in
| > some other way?
| >
| > EC> Another problem with the same application: when we have 2 clients
| > EC> connected and connect a third one everything goes well. But when
the
| > EC> client disconnects the 1st connected client has the same problem as
the
| > EC> server2server connecting. I debugged the code and saw that the
server
| > EC> still (tries to) send information to the client.
| >
| > It seems like an application error not Sockets fault....
| >
| > --
| > Regards, Vadym Stetsyak
| > www: http://vadmyst.blogspot
 
Back
Top