Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Mar 2009 04:53:19 -0400
From:      Yoshihiro Ota <ota@j.email.ne.jp>
To:        freebsd-hackers@freebsd.org
Subject:   2 uni-directional TCP connection good?
Message-ID:  <20090320045319.04484fc5.ota@j.email.ne.jp>

next in thread | raw e-mail | index | archive | help
Hi forks.

I have question on network programming.
It will be nice if some could answer.

I saw a program that opens 2 TCP connections.
One connection is only used for server to client messaging only
and the other connection is used only for client to server messaging.

First of all, because TCP is already bi-directional communication,
I don't think it is unnecessary to make 2 connection in the first place.


After talking to my friend, he said it was very bad to do such things
for three reasons.

1. With TCP connections, only sender side can detect some communication
issues passively if happened.  By using two connections, you lost that
ability by your self.  I agree on this one.

2. He also said that it would also waste network bandwidth.

3. He also said that it would causes some data flushing/synchronization
issues.  Indeed, this was what I saw with the program.  However, I couldn't
understand why it could happen.  What I saw was from time to time, the
sender side reported it send messages with some sequence numbers but
the receiver didn't actually receive these messages for a long time,
I think it was about a couple of seconds to several seconds between
two hosts on the same switch.

Could anyone explain if #2 is true and why #3 happens?

Regards,
Hiro



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090320045319.04484fc5.ota>