named-pipes

C++ Using windows named pipes

寵の児 提交于 2019-12-04 05:14:15
For some reason both the mast and slave fail, however I could find any good examples on how their meant to work, so im not sure where I went wrong. The master never exits the WaitForSingleObject after ConnectNamedPipe, and the slave throws an exception in the first boost::asio::read call, "Waiting for a process to open the other end of the pipe", which I though the WaitNamedPipe was meant to wait for along with the ConnectNamedPipe in the master? master.cpp asio::io_service ioservice; asio::windows::stream_handle in(ioservice); int main() { HANDLE pipe = INVALID_HANDLE_VALUE; try { //create

WCF security problems with named pipes

爷,独闯天下 提交于 2019-12-04 04:54:09
问题 I have a slightly complicated setup that, of course, works fine in XP, but chokes on Windows 7. It may seem like madness, but it made sense at the time! I have a WPF application that launches and then launches another application that communicates with an external device. After launching it establishes communications with the new process using WCF (hosted by the new process) via a named pipe (net.pipe). This seems to work fine on either OS. I wanted to make some of the functionality of the

SQL Server Error “Named Pipes Provider: Could not open a connection to SQL Server [53]”

与世无争的帅哥 提交于 2019-12-04 03:09:50
问题 I used to have a desktop application pointing to a Sybase database through an .ini file that had this connection string: CONNECTION_NAME = "DSN="Dna_Name";UID="User";PWD="Password"" It worked perfectly. A few days ago the database has been migrated to SQL Server 2008 R2 and I need to update the .ini file to redirect the new production server. I updated the connection string as follow: CONNECTION_NAME = "Provider=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=

read not blocking on named pipe

自作多情 提交于 2019-12-04 01:18:27
i have the following bit of C code which reads from a pipe and then should block but it never blocks int pipe_fd; int res; int open_mode = O_RDONLY; char buf[100]; int bytes_read = 0; memset (buf, '\0', sizeof(buf)); pipe_fd = open(FIFO_NAME, open_mode); if (access(FIFO_NAME, F_OK) == -1) { res = mkfifo(FIFO_NAME, 0777); if (res != 0) { fprintf (stderr, "Could not create fifo %s\n", FIFO_NAME); exit (EXIT_FAILURE); } } for(;;) { do { res = read(pipe_fd, buf, sizeof(buf)); bytes_read += res; }while (res > 0); // process data then go back and block ............ } It is sent a simple buffer by

C#: Asynchronous NamedPipeServerStream The pipe is being closed exception

烈酒焚心 提交于 2019-12-03 20:07:28
My previous question on the same theme: C#: Asynchronous NamedPipeServerStream understanding Now I have next: private void StartListeningPipes() { try { isPipeWorking = true; namedPipeServerStream = new NamedPipeServerStream(PIPENAME, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous, BUFFERSIZE, BUFFERSIZE); Console.Write("Waiting for client connection..."); while(isPipeWorking) { IAsyncResult asyncResult = namedPipeServerStream.BeginWaitForConnection(this.WaitForConnectionAsyncCallback, null); Thread.Sleep(3*1000); } } //// Catch the IOException that is raised if

Named Pipes - Asynchronous Peeking

本小妞迷上赌 提交于 2019-12-03 17:50:18
问题 I need to find a way to be notified when a System.IO.Pipe.NamedPipeServerStream opened in asynchronous mode has more data available for reading on it- a WaitHandle would be ideal. I cannot simply use BeginRead() to obtain such a handle because it's possible that i might be signaled by another thread which wants to write to the pipe- so I have to release the lock on the pipe and wait for the write to be complete, and NamedPipeServerStream doesnt have a CancelAsync method. I also tried calling

How do I make named pipes work between c++ and .NET?

蓝咒 提交于 2019-12-03 17:17:34
I just had a really tough time making Named Pipes work between c++ and .NET. I had no problems creating Named Pipes that worked between 2 c++ apps, or between 2 .NET apps. I dont have problem with this communication, i use this scenario in some project. C++ side: LPTSTR lpszPipename = TEXT("\\\\.\\pipe\\pipename"); CHAR chReadBuf[1024]; DWORD cbRead; BOOL fResult; fResult = CallNamedPipe( lpszPipename, // pipe name _Message, // message to server strlen(_Message), // message length chReadBuf, // buffer to receive reply sizeof(chReadBuf), // size of read buffer &cbRead, // number of bytes read

Can't write to named pipe

三世轮回 提交于 2019-12-03 17:15:10
问题 I'm trying to write to a named pipe, made with mkfifo . But when I run the command, (ex) ls > myNamedPipe , I can no longer enter commands into the bash. I can still write characters and that's pretty much it. 回答1: A named pipe remains opened until you read it from some other place. This is to permit communication between different processes. Try: mkfifo fifo echo "foo" > fifo Then open another terminal and type: cat fifo If you return to you first terminal, you'll notice that you can now

Named pipes performance issues

淺唱寂寞╮ 提交于 2019-12-03 16:39:29
I'm using named pipes for inter-procedural communication between C# and Delphi. C# uses the System.IO.Pipes package, whereas Delphi makes use of Libby's pipes.pas . Unfortunately, the communication is all but high-performance: Profiling showed me that the communication takes 72% of the whole runtime, the rest is used by calculations. I was able to locate one problem that could take up resources: If I don't explicitly disconnect the sending client's connection in Delphi, C# doesn't receive any data at all . Delphi (sending) FClient1.Write(msg[1], Length(msg)); FClient1.FlushPipeBuffers;

is NetNamedPipeBinding safe?

心已入冬 提交于 2019-12-03 16:12:49
问题 I would like to know if netNamedPipeBinding is considered safe: On one hand NetNamedPipeBinding implements security only on the transport Layer and it uses NTLM (source) that is no longer recommended by Microsoft (source) On the other hand the Named Pipie is not accessible from a remote computer, and there is no way to eavesdrop on a particular open pipe instance being used to transfer data, or write data to it, unless one can obtain the handle to the specific instance concerned. This is the