NamedPipeServerStream와 NamedPipeClientStream Pipe 로 연결 시 에러가 낫다.



테스트 환경에서 에러가 나지 않았는데 왜 그럴까..

구글링을 통해 찾아냈고, 먼저 찾아내신 개발자 분이 계셔서 기록을 남기게 되었다.

클라이언트쪽에서 연결시 에러가 났는데, 서버쪽 코드는 아래와 같다.

1
2
3
4
5
var pipeServer = new NamedPipeServerStream(pipeName, PipeDirection.In, numThreads);
 
var threadId = Thread.CurrentThread.ManagedThreadId;
 
pipeServer.WaitForConnection();
cs

PipeDirection.In 으로 한 이유는 서버쪽에서는 클라이언트에게 데이터를 넘길 필요가 없어서였다.

그런데 양쪽 방향으로 해줘야 연결이 된다..

1
2
3
var pipeServer = new NamedPipeServerStream(pipeName, PipeDirection.InOut, numThreads);
var threadId = Thread.CurrentThread.ManagedThreadId;
pipeServer.WaitForConnection();
cs


이건 단지 해결방법이었고, 원인은 추가적으로 올릴 기회가 있으면 올리겠습니다.~

출처 : http://adventuresindevelopment.blogspot.kr/2008/07/named-pipes-issue-systemunauthorizedacc.html

'.NET 개발 > C#' 카테고리의 다른 글

Xaml web browser application .xbap 캐시 지우기  (0) 2015.12.21
WebSecurity 클래스  (0) 2015.12.03
명명된 파이프  (0) 2015.11.11
C# MailMessage 클래스로 네이버 메일 이용하기.  (0) 2015.11.10
EntityFramework 활용하기.  (0) 2015.11.09
Posted by Hoya0415
,