named-pipes

C# 3.5 - Connecting named pipe across network

99封情书 提交于 2019-11-28 12:50:53
What is the correct way to setup a named pipe in C# across a network? Currently I have two machines, 'client' and 'server'. Server sets up its pipe in the following manner: NamedPipeServerStream pipeServer = new NamedPipeServerStream( "pipe", PipeDirection.InOut, 10, PipeTransmissionMode.Byte, PipeOptions.None) pipeServer.WaitForConnection(); //... Read some data from the pipe The client sets up its connection in the following manner: NamedPipeClientStream pipeClient = new NamedPipeClientStream( "server", "pipe", PipeDirection.InOut); pipeClient.Connect(); //This line throws an exception //...

Concurrent read/write of named pipe in Java (on windows)

↘锁芯ラ 提交于 2019-11-28 10:32:12
I'm trying to provide communication between a C# app and a Java app on windows using named pipes with the method described by v01ver in this question: How to open a Windows named pipe from Java? I'm running into a problem on the Java side because I have a reader thread constantly waiting for input on the pipe and when I try to write to the pipe from my main thread it gets stuck forever. final RandomAccessFile pipe; try { pipe = new RandomAccessFile("\\\\.\\pipe\\mypipe", "rw"); } catch (FileNotFoundException ex) { ex.printStackTrace(); return; } Thread readerThread = new Thread(new Runnable()

Importing zipped CSV file into PostgreSQL

久未见 提交于 2019-11-28 10:22:06
I have a big compressed csv file (25gb) and I want to import it into PostgreSQL 9.5 version. Is there any fast way to import zip or qzip file into postgres without extracting the file? There is an old trick to use a named pipe (works on Unix, don't know about Windows) create a named pipe: mkfifo /tmp/omyfifo write the file contents to it: zcat mycsv.csv.z > /tmp/omyfifo & [from psql] copy mytable(col1,...) from '/tmp/omyfifo' [when finished] : rm /tmp/omyfifo The zcat in the backgound will block until a reader (here: the COPY command) will start reading, and it will finish at EOF. (or if the

Win32 named pipes and remote clients

折月煮酒 提交于 2019-11-28 10:04:28
Can I access a named pipe on computer A from computer B given computer A's IP address? If so, what do I need to do to make this happen? Yes you can communicate across the network via named pipes. You specify the pipe name like a UNC path: \\computername\pipe\pipename or via IP \\192.168.0.100\pipe\pipename You can do this for any LAN machine, or for any remote machine connected to your LAN via VPN. You use all of the same pipe Win32 API functions such as CreateFile . To create the pipe you use CreateNamedPipe . Before you can use a remote pipe, you must have a valid connection to the remote

git stderr output can't pipe

五迷三道 提交于 2019-11-28 09:11:50
I'm writing a graphical URI handler for git:// links with bash and zenity, and I'm using a zenity 'text-info' dialog to show git's clone output while it's running, using FIFO piping. The script is about 90 lines long, so I won't bother posting it here, but here's the most important lines: git clone "$1" "$target" 2>&1 | cat >> /tmp/githandler-fifo & cat /tmp/githandler-fifo | zenity --text-info --text='Cloning git repository' & I'm using FIFO instead of a direct pipe to allow them to run asynchronously and allow for killing git if the zenity window is closed. Problem is, the only line that

SQL Connection Error: System.Data.SqlClient.SqlException (0x80131904)

拟墨画扇 提交于 2019-11-28 09:07:05
I am seeing this in several situations and it is intermittent in our web based application connecting to SQL 2008 R2 serve back end. Users are coming across a point 2 point connection and seeing this on and off. Thought it was bandwidth issues until I started seeing it on terminal servers that are on the same core switch as this SQL server. I have checked remote connection enabled, Port 1433 is set correctly in Configuration for TCP/IP and the only thing I see that could be a cause is the timeout setting is set to 100000 in the remote connections rather than unlimited. The error is System.Data

Two way C++ to C# communication using named pipes

无人久伴 提交于 2019-11-28 07:41:03
问题 I am trying to have a 2-way communication between a VC++ 6 app and a C# app. I am using named pipes. In my C++ code I can read the message from the C# client but then the server "dies" and I have to restart it again. What I want to do is have the C# app connect to the C++ app, request a status, and the C++ app goes off and checks the status, and then returns either "busy" or "idle". I can't write anything back to the C# client as it says the connection has been closed. Some things I have

How to create a virtual file?

China☆狼群 提交于 2019-11-28 06:32:17
I'd like to simulate a file without writing it on disk. I have a file at the end of my executable and I would like to give its path to a dll. Of course since it doesn't have a real path, I have to fake it. I first tried using named pipes under Windows to do it. That would allow for a path like \\.\pipe\mymemoryfile but I can't make it works, and I'm not sure the dll would support a path like this. Second, I found CreateFileMapping and GetMappedFileName. Can they be used to simulate a file in a fragment of another ? I'm not sure this is what this API does. What I'm trying to do seems similar to

How do I use exec 3>myfifo in a script, and not have echo foo>&3 close the pipe?

安稳与你 提交于 2019-11-28 05:22:44
问题 Why can't I use exec 3>myfifo in the same manner in a bash script as I can in my terminal? I'm using named pipes to turn an awk filter into a simple "server", that should be able to take text input from clients, filter it, and flush on NUL. In terminal 1, the server is running like this: $ mkfifo to_server from_server; $ while true; do # Really, this awk script BEGIN's with reading in a huge file, # thus the client-server model awk '{sub("wrong", "correct");print;} /\0/ {fflush();}' <to

Strange intermittent SQL connection error, fixes on reboot, comes back after 3-5 days (ASP.NET)

冷暖自知 提交于 2019-11-28 05:00:23
问题 For some reason every 3-5 days our web app loses the ability to open a connection to the db with the following error, the strange thing is that all we have to do is reboot the container (it is a VPS) and it is restored to normal functionality. Then a few days later or so it happens again. Has anyone ever had such a problem? I have noticed a lot of ANONYMOUS LOGONs in the security log in the middle of the night from our AD server which is strange, and also some from an IP in Amsterdam. I am