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. Terminal Server Problem

Terminal Server Problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++sysadminoopannouncement
1 Posts 1 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.
  • S Offline
    S Offline
    Spiros
    wrote on last edited by
    #1

    Hi everybody I am creating an application using VC++ that runs on a terminal server with 30 end users. The end users will use thin clients as front end machines. The application consists of a main menu executeble that opens other executables depending on the user selection. In order to establish that communication I use named pipes. Actually I use 1 named pipe as the main tube for data transfer. What happens is that sometimes the session of any user may freeze and another user may view his data. As a result I have started suspecting that something is wrong with the method that creates the child process and also that at a certain point one user may "use" the name pipe share of the other. The code that performs the above call is: int CTransfer::StartTalking(CString szNewProcess, CNamedPipe* m_ServerObject, char *pszBuffer) { STARTUPINFO si; PROCESS_INFORMATION pi; char szProcess[128]; strcpy(szProcess , (LPCTSTR)szNewProcess); ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); szNewProcess += ".exe"; // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). szProcess, // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. TRUE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { return 1; } #ifndef _DEBUG if (strlen(pszBuffer)) { DWORD dwBytesWritten; if (m_ServerObject->ConnectClient()) m_ServerObject->Write(pszBuffer , strlen(pszBuffer), dwBytesWritten); } #endif // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); return 0; } I am thinking that I could do certain things such as: 1. create 1 named pipe per module in order to distribute traffic to more named pipes. 2. use a CreateMutex before the CreateProcess and Release it before the WaitforSingleObject I will definitely appreciate any opion or help that you might provide. Thank you for your time Spiros Prant

    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