Subject: Erroneous TCPIP filedescriptors
To: 'NetBSD kernel group' <tech-kern@netbsd.org>
From: Thomas Page <ThomasP@cat.co.za>
List: tech-kern
Date: 07/06/1999 17:10:27
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------ =_NextPart_001_01BEC7C1.AE015E60
Content-Type: text/plain

I am working with somthing that uses TCPIP to talk to the outside world,
and UDP to send messages between several different processes. A 'select'
forms the heart of the application, as it waits for the UDP messages,
forwards them to a message handler, and for the TCPIP, which waits for a
suitable partner to connect to (works OK), then to indicate waiting
data. The connection 'accept' spawns a new fd, which is then listened to
in the 'select'.

The problem I have is that: after a connection is made, then control
reverts back to the main program, and ultimately sits waiting for action
in the 'select', as it enters the select, the fd for the TCP causes a
'Bad File Descriptor' from strerror(errno).
1) Is it OK to use select for more than just making connections?
2) Is there some other lurking error, I've had 'TCP persistance'
mentioned, bearing in mind that the problem is erratic.

Thomas Page
thomasp@cat.co.za   (tompage@hotmail.com) +27 31 560 6556

"I can not be intimidated, bought, or blackmailed. I can only be
inspired."
Unknown 20th century poet


------ =_NextPart_001_01BEC7C1.AE015E60
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.1960.3">
<TITLE>Erroneous TCPIP filedescriptors</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">I am working with somthing that uses =
TCPIP to talk to the outside world, and UDP to send messages between =
several different processes. A 'select' forms the heart of the =
application, as it waits for the UDP messages, forwards them to a =
message handler, and for the TCPIP, which waits for a suitable partner =
to connect to (works OK), then to indicate waiting data. The connection =
'accept' spawns a new fd, which is then listened to in the =
'select'.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">The problem I have is that: after a =
connection is made, then control reverts back to the main program, and =
ultimately sits waiting for action in the 'select', as it enters the =
select, the fd for the TCP causes a 'Bad File Descriptor' from =
strerror(errno).</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">1) Is it OK to use select for more =
than just making connections?</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">2) Is there some other lurking error, =
I've had 'TCP persistance' mentioned, bearing in mind that the problem =
is erratic.</FONT></P>

<P><FONT FACE=3D"Tahoma">Thomas Page<I></I></FONT><I></I>
<BR><FONT SIZE=3D1 FACE=3D"Tahoma">thomasp@cat.co.za&nbsp;&nbsp; =
(tompage@hotmail.com) +27 31 560 6556</FONT>
</P>

<P ALIGN=3DCENTER><FONT SIZE=3D1 FACE=3D"Tahoma">&quot;I can not be =
intimidated, bought, or blackmailed. I can only be =
inspired.&quot;</FONT></P>

<P ALIGN=3DCENTER><FONT SIZE=3D1 FACE=3D"Tahoma">Unknown 20th century =
poet</FONT></P>

</BODY>
</HTML>
------ =_NextPart_001_01BEC7C1.AE015E60--