473,804 Members | 3,941 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c++ named pipe example

Hi Gurus,

I am a newbee in C++ field. And I have been assigned to complete a
task of create a template class, so that names pipes can be created
using this template. I don't have a clue from where to start ...

I would be thankful if you could provide my any such template or
refernce to start.

Best regards,
Jul 22 '05 #1
5 16827

"rajnish" <ra************ @gmail.com> wrote in message
news:3d******** *************** ***@posting.goo gle.com...
Hi Gurus,

I am a newbee in C++ field. And I have been assigned to complete a
task of create a template class, so that names pipes can be created
using this template. I don't have a clue from where to start ...
I would suggest that you ask the person who made the assignment. This is not
an easy or obvious task and it is unfair to ask you to do it if you don't
have any clue.

I would be thankful if you could provide my any such template or
refernce to start.


The named pipe part is off topic in this group. C++ does not have named
pipes so if you need to know how to create named pipes you should ask on a
group that discusses programming on whatever operating system you are using.

But in general terms what you need to do is derive a new class from
basic_streambuf . Here is a link that discusses this
http://ou800doc.caldera.com/en/SDK_c...f_Classes.html.
However this discusses deriving from streambuf not basic_streambuf . The
differrence is that streambuf works on char only, but basic_streambuf is a
template where the type of character is the first template parameter. Since
you've been asked to write a template I guess that you need to derive from
basic_streambuf . But the principles are pretty similar in either case.

I have no idea of the quailty of the link above, it was just the first hit I
got with google.

john
Jul 22 '05 #2
rajnish wrote:
Hi Gurus,

I am a newbee in C++ field. And I have been assigned to complete a
task of create a template class, so that names pipes can be created
using this template. I don't have a clue from where to start ...


Named pipes are not part of the C++ language, so this question is
off-topic here. Suggest you try a unix newsgroup.

--
Lionel B

Jul 22 '05 #3

"Lionel B" <go****@lionelb .com> wrote in message
news:10******** **************@ z14g2000cwz.goo glegroups.com.. .
rajnish wrote:
Hi Gurus,

I am a newbee in C++ field. And I have been assigned to complete a
task of create a template class, so that names pipes can be created
using this template. I don't have a clue from where to start ...


Named pipes are not part of the C++ language, so this question is
off-topic here. Suggest you try a unix newsgroup.


I/O in general terms is certainly on topic here.

Named pipes also exist on Windows.

john
Jul 22 '05 #4
"John Harrison" <jo************ *@hotmail.com> wrote in message news:<2t******* ******@uni-berlin.de>...
"Lionel B" <go****@lionelb .com> wrote in message
news:10******** **************@ z14g2000cwz.goo glegroups.com.. .
rajnish wrote:
Hi Gurus,

I am a newbee in C++ field. And I have been assigned to complete a
task of create a template class, so that names pipes can be created
using this template. I don't have a clue from where to start ...


Named pipes are not part of the C++ language, so this question is
off-topic here. Suggest you try a unix newsgroup.


I/O in general terms is certainly on topic here.

Named pipes also exist on Windows.

john


This template should be in c++ i.e. cross-platform (compiled using
gcc) ... was able to write simple c like code but not template ... I
wish if there could be any libaray with such a functionality :) ... I
think it is matter of time to learn templates ... only sorry thing is
time :( (which I am lacking at this moment)

Any help .. thanks in advance !!!
Jul 22 '05 #5
>
This template should be in c++ i.e. cross-platform (compiled using
gcc) ... was able to write simple c like code but not template ... I
wish if there could be any libaray with such a functionality :) ... I
think it is matter of time to learn templates ... only sorry thing is
time :( (which I am lacking at this moment)


It's not just templates that you have to learn, its the C++ I/O system. In
fact I wouldn't bother with a template at first. Just write your own stream
class, this means deriving classes from streambuf like I described earlier.
You can add in the template later, I think this will be the easier part of
the project.

john
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7467
by: Rajarshi Guha | last post by:
Hi, I'm having a little trouble when I read from a named pipe. I create a pipe by os.mkfifo('/tmp/mypipe') and then open it for reading with fin = open('/tmp/mypipe','r+')
6
10766
by: Srijit Kumar Bhadra | last post by:
Hello, Here is an example of Multithreaded Pipe Server and Client using the excellent ctypes library (Windows). Reference - MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/multithreaded_pipe_server.asp and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/named_pipe_client.asp Best Regards,
5
17426
by: richard | last post by:
I have a simple test to pass information from a client to a server using named pipe. what I really want is: when I type a line on the client, the server will output the line immediately. but to my surprise, I always have to terminate the client to get the server in action, i.e. prints out what I typed. anything I missed? I am compiling using gcc without any option. thanks, ---RICH
4
7664
by: Ken Allen | last post by:
Is there any built-in facility for handling named pipes in C#/.Net, or must one use unsafe code to access the WIN32 API directly? There exists some code that uses named pipes heavily and there exists a need for that code to send some information to a new .Net service I am writing. It is a relatively simple matter for the existing code to use a named pipe to send the data, but I can find no references to how I can create the named pipe...
3
2640
by: EricR | last post by:
I am trying to use .NET to "tap into" a named pipe created by a non .NET 3rd party application. Specifically, the application is a table loading utility. It opens a named pipe and waits for input. Does anybody know how I can write to the named pipe from a .NET program. I have tried using the traditional file access methods, and it appears that pipes have a problem with file streams. I have tried API calls, but since I do not have the...
0
1459
by: Nick | last post by:
hi,all I have a question about named pipe. How does the pipe server know the client closed the connection? We can refer the example for CreateNamedPipe() function in MSDN. In block mode, once ConnectNamedPipe() returns, it means the client called CreateFile(), and after finish reading and writing, client call CloseHandle(), at this point, how does the pipe server know the pipe has been closed? And if client did not call CloseHandle(),...
2
5069
by: FB's .NET Dev PC | last post by:
I am writing two services in VB.NET, one of which needs to send text strings to the other. After reading, I decided (perhaps incorrectly) that named pipes would be the best interprocess communication method for this task. I set about creating, on the pipe's server side, a new thread which would instantiate a blocking inbound message pipe, and the client side which would write to that pipe when needed. Being on the same PC, security is...
0
1218
by: EricR | last post by:
I am trying to use .NET to "tap into" a named pipe created by a non .NET 3rd party application. Specifically, the application is a table loading utility. It opens a named pipe and waits for input. Does anybody know how I can write to the named pipe from a .NET program. I have tried using the traditional file access methods, and it appears that pipes have a problem with file streams. I have tried API calls, but since I do not have the...
0
2916
by: olaf.dietsche | last post by:
Hi, The system is Windows XP and DB2 v8.1.7. I'm trying to load a text file via named pipe into a table. I have two programs: the first program creates the named pipe, waits for a client and writes the text file into the named pipe. the second program is doing the db2Load() call.
7
7659
by: andrewb | last post by:
Hi all, Having some trouble using named pipes and Visual Basic .NET and would appreciate and help you could offer. Essentially I am trying to develop a simple client/server application that exchanges text messages using named pipes. The internet resources seem a bit scarce and the only Microsoft resource I can find is http://support.microsoft.com/kb/871044.
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.