Working with named pipes

This is for discussing general topics about how to use VirtualBox.
Post Reply
Booster
Posts: 8
Joined: 10. Jul 2011, 16:37
Primary OS: MS Windows 2003
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Working with named pipes

Post by Booster »

Hello, everyone!
I'm trying to use named pipes for commucation between host and guest. host - Windows server 2003, guest - Windows XP. Firewall on the guest is disabled. I'm trying this code for open pipe
Writer:

Code: Select all

std::ofstream ofs = std::ofstream("\\\\.\\pipe\\xp1");
if (ofs.is_open())
{
	std::cout<< "Success" << std::endl;
	ofs << "Hello xp!!!" << std::endl;
}
else
{
	std::cout<< "Fail" << std::endl;
}
Reader:

Code: Select all

std::ifstream ifs = std::ifstream("\\\\.\\pipe\\xp1");
if (ifs.is_open())
{
	std::cout << "Success" << std::endl;
}
else
{
	std::cout<< "Fail" << std::endl;
}
"Writer" and "Reader" don't work on the guest at all - everytime Fail.
On the host "Reader" works unless i start "Writer" which writes "Success" only one time. After that "Writer" and "Reader show - Fail.
After rebooting of guest all repeats.
How should i use pipes for sending data?
In the VB i have "\\.\pipe\xp1" settings.
Version of VirtualBox is 4.0.10.
Thanks a lot.
Booster
Posts: 8
Joined: 10. Jul 2011, 16:37
Primary OS: MS Windows 2003
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Re: Working with named pipes

Post by Booster »

It's interesting but i didn't find pipe "xp1" in the VirtualBox. Perhaps i need use com port in the guest .
Post Reply