× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ahh, yes, that would do it.

I generally do something like:
if ( socket != NULL )
   close (socket);

NULL in C/C++ being defined as 0 in my implementation.

I've never thought about the case where the socket number was actually 0,
and it's never come up, I had better double check my code and think about
socket number 0.

Regards,

Jim Langston

-----Original Message-----
From: David Gibbs [mailto:dgibbs@mks.com]

"Jim Langston" <jlangston@celsinc.com> wrote in message
4450A3C6B2D8F940821FB6B28A4D55FE230EC9@MAIL2.celsinc.com">news:4450A3C6B2D8F940821FB6B28A4D55FE230EC9@MAIL2.celsinc.com...
> How is it that you are closing socket 0 if you don't have a handle to it?

Apparently socket isn't really a handle ... it's *JUST* a number.  When my
program started, the int variable I use to hold the socket was initialized
to zero.  Before my program opened up a new connection, it tried to close
the current one (because it assumed the previous connection had been closed
by the other side).  Thus, my program would close socket 0.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.