CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    62

    Help with named pipes

    Hi,

    I start a named pipe in a server process:

    pipe = CreateNamedPipe("\\\\.\\pipe\\Test", PIPE_ACCESS_DUPLEX | FILE_FLAG_WRITE_THROUGH, PIPE_TYPE_BYTE, PIPE_UNLIMITED_INSTANCES, 1000, 1000, 3000, NULL);


    and use it in a client with:


    pipe = CreateFile( "\\\\.\\pipe\\Test", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
    WriteFile(pipe, buffer, 7, (DWORD*)&y, NULL);
    CloseHandle(pipe);

    I receive the data on the server side but the problem is that i cannot open the pipe from the client again. I always get an error.

    Is there something that I am missing ?

    I really appreciate any help on this.

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Help with named pipes

    Quote Originally Posted by Zaph-0
    I always get an error.
    Well...what error?

  3. #3
    Join Date
    Oct 2002
    Posts
    1,134

    Re: Help with named pipes

    Are you doing the CreateFile(...) again?

    Is there a reason why you're closing the pipe immediately after doing the Write??
    Regards
    Robert Thompson

  4. #4
    Join Date
    Jul 2005
    Posts
    5

    Thumbs up Re: Help with named pipes

    iam comparing various IPC mechanisms.wanted to know whether named pipes,mail slots,RPCs and Sockets are secure or not.Can anybody help me???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured