Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Urgent Named Pipe issue

Urgent Named Pipe issue

Scheduled Pinned Locked Moved C / C++ / MFC
helpsecurityquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    A T I F
    wrote on last edited by
    #1

    I am trying to use named pipe to transfer data between two process. I have called the following code HANDLE hPipe; LPTSTR lpszPipename = "\\\\.\\pipe\\DataTransferPipe"; hPipe = CreateNamedPipe( lpszPipename, // pipe name PIPE_ACCESS_DUPLEX, // read/write access PIPE_TYPE_MESSAGE | // message type pipe PIPE_READMODE_MESSAGE | // message-read mode PIPE_WAIT, // blocking mode PIPE_UNLIMITED_INSTANCES, // max. instances 1024, // output buffer size 1024, // input buffer size 18000, // client time-out NULL); // no security attribute if (hPipe == INVALID_HANDLE_VALUE) { MessageBox("Error creating named pipe", "Named Pipe Error" , MB_OK); return; } bool bConnected = ConnectNamedPipe(hPipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); I want the system to be that if no client connect for say 3 sec the call ConnectNamedPipe should return false. Is this possible....how. In the above code it just locks on the ConnectNamedPipe call

    V 1 Reply Last reply
    0
    • A A T I F

      I am trying to use named pipe to transfer data between two process. I have called the following code HANDLE hPipe; LPTSTR lpszPipename = "\\\\.\\pipe\\DataTransferPipe"; hPipe = CreateNamedPipe( lpszPipename, // pipe name PIPE_ACCESS_DUPLEX, // read/write access PIPE_TYPE_MESSAGE | // message type pipe PIPE_READMODE_MESSAGE | // message-read mode PIPE_WAIT, // blocking mode PIPE_UNLIMITED_INSTANCES, // max. instances 1024, // output buffer size 1024, // input buffer size 18000, // client time-out NULL); // no security attribute if (hPipe == INVALID_HANDLE_VALUE) { MessageBox("Error creating named pipe", "Named Pipe Error" , MB_OK); return; } bool bConnected = ConnectNamedPipe(hPipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); I want the system to be that if no client connect for say 3 sec the call ConnectNamedPipe should return false. Is this possible....how. In the above code it just locks on the ConnectNamedPipe call

      V Offline
      V Offline
      vcplusplus
      wrote on last edited by
      #2

      BOOL SetNamedPipeHandleState( HANDLE hNamedPipe, // handle to named pipe LPDWORD lpMode, // pointer to new pipe mode LPDWORD lpMaxCollectionCount, // pointer to maximum collection count LPDWORD lpCollectDataTimeout // pointer to time-out value );

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups