Network Pipes

  • Thread starter Thread starter Lou
  • Start date Start date
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.
 
What is the P/Invoke layer?
using ?????



Nicholas Paldino said:
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]
- (e-mail address removed)

Lou said:
How do i connect to a named pipe as a client?
-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 said:
What is the P/Invoke layer?
using ?????



message news:%[email protected]...
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]
- (e-mail address removed)

Lou said:
How do i connect to a named pipe as a client?
-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 said:
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]
- (e-mail address removed)

Lou said:
How do i connect to a named pipe as a client?
-Lou
 
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]
- (e-mail address removed)

Lou said:
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???


message news:%[email protected]...
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]
- (e-mail address removed)

Lou said:
How do i connect to a named pipe as a client?
-Lou
 
Back
Top