473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 16806

"rajnish" <ra************@gmail.com> wrote in message
news:3d**************************@posting.google.c om...
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.googlegr oups.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.googlegr oups.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
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
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:...
5
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...
4
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...
3
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....
0
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...
2
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...
0
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....
0
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...
7
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.