UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » Bug Reports
  • » Inconsistency in connecting the client to a server-- URGENT

#1 2002-12-02 03:36 PM

divya
Guest

Re: Inconsistency in connecting the client to a server-- URGENT

Hello,

I have a serious problem while connecting a client to server(itterative loopback).
For the first time the client will connect without delay. But  next time onwards there is a consistent delay of 3 secs while connecting.

When i analyze the packet sequence using a packet analyzer ,

-->I could see that the client will send   "FIN,ACK"  once it receives the  data from the server.

-->Before the server sends back the  "FIN,ACK" , the client will request for another
connection by sending "SYN".

-->Since the server has not  send the "FIN, ACK" back it will send a "RST" to the client.

--> the client will try again by sending the "SYN' .

I want to know is it the problem with client or the server?

Can anyone help me?..
Thanks in advance
Divya

#2 2002-12-02 11:32 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,826
Website

Re: Inconsistency in connecting the client to a server-- URGENT

It sounds to me like maybe your client is trying to reuse port#'s...
If so, don't do that... ;-)  Client's should rarely ever use any specific
port#, but should always just let the system assign them a new unused
ephemeral one...  If for some strange reason, your client NEEDS to
reuse the same specific port#, well then you've got problems...  I
think in THAT case, you might need to screw around with SO_LINGER,
and try to tear your connections down with RST, rather than FIN...
But, in general, that's a very BAD and dangerous idea, so I don't
recommend it at all...  Instead, I'd recommend changing your design
so your clients need not be on some specific fixed port#...

If you don't think you're reusing client port#'s, then post some code
from the client (all socket-related calls, at least)...

Offline

  • Index
  • » Bug Reports
  • » Inconsistency in connecting the client to a server-- URGENT

Board footer

Powered by FluxBB