public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Matt Jerdonek <maj1224@yahoo.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Discussion eCos <ecos-discuss@sources.redhat.com>
Subject: Re: [ECOS] TCP Transactions
Date: Tue, 21 Oct 2003 15:42:00 -0000	[thread overview]
Message-ID: <20031021154244.53999.qmail@web14206.mail.yahoo.com> (raw)
In-Reply-To: <20031021071625.GA14931@lunn.ch>


--- Andrew Lunn <andrew@lunn.ch> wrote:
> On Mon, Oct 20, 2003 at 04:27:11PM -0700, Matt
> Jerdonek wrote:
> > Hello again,
> > 
> > I'm developing an application that sends small
> > transactions via TCP.  The basic flow is 1) Bring
> up
> > the connection 2) Send request 3) Get response 4)
> > Bring down the connection.  Simple enough ...
> > 
> > But, when running any volume of transactions, all
> my
> > socket file descriptors get stuck in TIME_WAIT
> state. 
> > When this occurs, my application is effectively
> > disabled until a file descriptor times out.
> 
> Is this the client or the server end that has the
> problem?
> 
> Are you doing a setsocketopt() for SO_REUSEADDR?
> 
> 
>     Andrew
> 
Andrew,

Thanks for the reply.  My code is the client end of
the connection.  Initially, my code was a call only to
socket() and a call to connect().  I changed it to a
call to socket(), setsockopt(REUSEADDR),
setsockopt(REUSEPORT), bind(), and connect().  In both
cases,  it failed.  Please look at the following code
from bsd_tcpip/ver/src/sys/netinet/tcp_usrreq.c
-------------------------------------
/*
 * Cannot simply call in_pcbconnect, because there
 * might be an
 * earlier incarnation of this same connection still
in
 * TIME_WAIT state, creating an ADDRINUSE error.
 */
oinp = in_pcblookup_hash(...);
if (oinp) {
	if (...RFC1644 check...)
	        otp = tcp_close(otp);
	else
		return EADDRINUSE;
	} 
-----------------------------------
I think I have to find a method to shorten the
TIME_WAIT state.  The TIME_WAIT state is defined as 2
* MSL (or 60 seconds).  If I make the MSL
configurable, I can shorten the TIME_WAIT.  Is this
reasonable?

Thanks,
-- Matt


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

  reply	other threads:[~2003-10-21 15:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-20 23:27 Matt Jerdonek
2003-10-21  7:16 ` Andrew Lunn
2003-10-21 15:42   ` Matt Jerdonek [this message]
2003-10-21 16:06 ` David Vrabel
2003-10-21 17:49   ` Matt Jerdonek
2003-10-21 19:11 ` Andrew Lunn
2003-10-23 18:32   ` Matt Jerdonek
2003-10-23 20:15     ` Andrew Lunn
2003-10-24 16:38       ` Matt Jerdonek
2003-10-28 12:50         ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031021154244.53999.qmail@web14206.mail.yahoo.com \
    --to=maj1224@yahoo.com \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).