🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2180

Re: Named Pipes problem

#2180
From: Martin
Date: Mon, 23 Apr 2007 19:34
38 lines
2450 bytes
Remy Lebeau (TeamB) wrote:
> "Martin" <dev@no.comppromed.spam.com> wrote in message
> news:462cc3e6$1@newsgroups.borland.com...
> 
>> Using BCB 5 Pro, I'm trying to add named pipes to my app, and
>> having some problems after the first client disconnects and shutdown
>> Basically what's happening is that the server is getting error 232
>> (pipe closing), 233 (no process at other end of pipe), or 6 (invalid
>> handle) when it's trying to use the pipe created for the second
> client.
> 
> Did you call DisconnectNamedPipe() after the first client
> disconnected?  You can't reuse an existing server pipe unless you do.
> This is stated in the documentation.
> 

Yes, DisconnectNamedPipe is being called.

>> Has anyone tried getting named pipes to work in this model? How
>> necessary is it to use _beginthread instead of CreateThread?
> 
> It is not necessary at all.  I have plenty of named pipe code that
> works just fine with CreateThread().
> 

Thanks. I tried using the TThread class and that seems to work fine as 
well.  Is it possibly something specific to BCB 5 that the Borland docs 
say _beginthread is required for the runtime libraries. The backend to 
these pipes are calling a lot of routines that use Borland's versions of 
the API calls instead of calling directly to Windows API. Bypassing 
_beginthread isn't going to cause any problems will it?

Thanks,
Marty
> 
> Gambit
> 
> 
Technical Details
Message-ID: <462d0a59@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <462cc3e6$1@newsgroups.borland.com> <462cf7ad$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6ec9191177bf375b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 23 Apr 2007 12:34:44 -0700
From: Martin <dev@no.comppromed.spam.com>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Named Pipes problem
References: <462cc3e6$1@newsgroups.borland.com> <462cf7ad$1@newsgroups.borland.com>
In-Reply-To: <462cf7ad$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.201.233.20
Message-ID: <462d0a59@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1177356889 208.201.233.20 (23 Apr 2007 12:34:49 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail