Working with named pipes
Posted: 10. Jul 2011, 17:37
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:
Reader:
"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.
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;
}
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;
}
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.