473,385 Members | 1,593 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,385 software developers and data experts.

Network Pipes

Lou
How do i connect to a named pipe as a client?
-Lou
Nov 15 '05 #1
5 2088
Lou,

You can call the CreateFile API through the P/Invoke layer. Once you
have the handle to the pipe, you can pass it to the constructor of the
FileStream class to read from/write to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lou" <lo********@comcast.net> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
How do i connect to a named pipe as a client?
-Lou

Nov 15 '05 #2
Lou
What is the P/Invoke layer?
using ?????

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2***************@tk2msftngp13.phx.gbl...
Lou,

You can call the CreateFile API through the P/Invoke layer. Once you
have the handle to the pipe, you can pass it to the constructor of the
FileStream class to read from/write to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lou" <lo********@comcast.net> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
How do i connect to a named pipe as a client?
-Lou


Nov 15 '05 #3
Lou
Here is my code snippet

using System;

using System.Runtime.InteropServices;

using System.IO;

using Microsoft.Win32;
public int ConnectToPipe(string machineName,string pipeName)

{

string connectionString;

int res;

connectionString="\\\\" + machineName +"\\" + pipeName;
res = WaitNamedPipe(connectionString, 5000);
}'

"Lou" <lo********@comcast.net> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
What is the P/Invoke layer?
using ?????

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2***************@tk2msftngp13.phx.gbl...
Lou,

You can call the CreateFile API through the P/Invoke layer. Once you have the handle to the pipe, you can pass it to the constructor of the
FileStream class to read from/write to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lou" <lo********@comcast.net> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
How do i connect to a named pipe as a client?
-Lou



Nov 15 '05 #4
Lou
CreateFile returns a int
The FileSystemObjectcs contructor won't take an int???

I can get a handle using CreateFile but the fileSystemObject chokes on it???
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2***************@tk2msftngp13.phx.gbl...
Lou,

You can call the CreateFile API through the P/Invoke layer. Once you
have the handle to the pipe, you can pass it to the constructor of the
FileStream class to read from/write to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lou" <lo********@comcast.net> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
How do i connect to a named pipe as a client?
-Lou


Nov 15 '05 #5
Lou,

Your definition of CreateFile should return an IntPtr, not an int. You
use IntPtr for things such as pointers, handles, etc, etc, where the size of
the integer is dependent on the platform.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lou" <lo********@comcast.net> wrote in message
news:eI**************@TK2MSFTNGP09.phx.gbl...
CreateFile returns a int
The FileSystemObjectcs contructor won't take an int???

I can get a handle using CreateFile but the fileSystemObject chokes on it???

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2***************@tk2msftngp13.phx.gbl...
Lou,

You can call the CreateFile API through the P/Invoke layer. Once you have the handle to the pipe, you can pass it to the constructor of the
FileStream class to read from/write to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Lou" <lo********@comcast.net> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
How do i connect to a named pipe as a client?
-Lou



Nov 15 '05 #6

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

Similar topics

0
by: Christian Hammers | last post by:
Hello I would like to call a unix shellscript from within a PHP script and - write data to its STDIN - read data from its STDOUT *and* STDERR - get its exit code afterwards proc_open seems...
1
by: Georg Kreyerhoff | last post by:
Hi, In order to establish a security enhanced SQL server setup, I tried to switch off network access by disabling all networking protocols, so that the server can only be reached through a pipe....
2
by: James | last post by:
Periodically, our entire website will display the following error for all users when requests are made to ASP pages: DBMSSOCN General Network Error HTML pages will load just fine, and I...
9
by: Hans J?rg Brinksmeyer | last post by:
Hi, does anyone have an idea for this problem: I use anonymous pipes to steer a console program under Win2000 with a second 'steering aplication'. The stdin and output are redirected to...
3
by: Bonj | last post by:
I need to write a windows service, and the only way it can access a shared drive on a file server on the network is if the installer is put in "User" mode - "LocalService", "LocalSystem" and...
0
by: xz | last post by:
I just installed Visual web dev. 2005 beta 1. I've never used the lite SQL server 2005 database, so I decided to try it out. From the Visual web dev. I selected 'create new sql server database' ...
7
by: Alan Pretre | last post by:
I have an application installed at a customer site that has been getting a general network error for a couple of years. I was hoping that .NET 2.0 would clear it up, but unfortunately it didn't. ...
0
by: John J. Hughes II | last post by:
I am using the following code to monitor a socket port. The code normally works fine unless a network connection is lost. Since both ends of the conversation on the same computer (normally) this...
1
by: steve1rm | last post by:
Hello, I have a problem trying to connect a remote sql server. The error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may...
3
by: ZhukovL | last post by:
I'm having some trouble implementing the handling of multiple pipes in a shell I'm writing. I was hoping someone could point me in the right direction because I really cant see where I'm going...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.