473,785 Members | 3,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Terminal Server - Named pipe

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::Star tTalking(CStrin g szNewProcess, CNamedPipe* m_ServerObject, char *pszBuffer)
{
STARTUPINFO si;
PROCESS_INFORMA TION pi;
char szProcess[128];

strcpy(szProces s , (LPCTSTR)szNewP rocess);

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_INFORMA TION structure.
)
{
return 1;
}
#ifndef _DEBUG
if (strlen(pszBuff er))
{
DWORD dwBytesWritten;
if (m_ServerObject->ConnectClient( ))
m_ServerObject->Write(pszBuffe r , strlen(pszBuffe r), dwBytesWritten) ;
}
#endif
// Wait until child process exits.
WaitForSingleOb ject( 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 WaitforSingleOb ject

I will definitely appreciate any opion or help that you might provide.
Thank you for your time

Spiros Prantalos

Nov 16 '05 #1
0 1552

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11413
by: Aquila Deus | last post by:
Hi all! I just tried to enable TCP/IP on SQL Server 2000 (trial, SP3a). The Server Network Utility shows it's already turned on, but after restarting the server doesn't listen to any TCP port, and in the eventlog it reports "SuperSocket info: gethostbyname(MSAFD Tcpip ) : Error 11004." and "SuperSocket info: (SpnRegister) : Error 2102.". I googled but found nothing helpful. Does anyone know what's wrong??
3
2637
by: EricR | last post by:
I am trying to use .NET to "tap into" a named pipe created by a non .NET 3rd party application. Specifically, the application is a table loading utility. It opens a named pipe and waits for input. Does anybody know how I can write to the named pipe from a .NET program. I have tried using the traditional file access methods, and it appears that pipes have a problem with file streams. I have tried API calls, but since I do not have the...
0
1215
by: EricR | last post by:
I am trying to use .NET to "tap into" a named pipe created by a non .NET 3rd party application. Specifically, the application is a table loading utility. It opens a named pipe and waits for input. Does anybody know how I can write to the named pipe from a .NET program. I have tried using the traditional file access methods, and it appears that pipes have a problem with file streams. I have tried API calls, but since I do not have the...
0
2913
by: olaf.dietsche | last post by:
Hi, The system is Windows XP and DB2 v8.1.7. I'm trying to load a text file via named pipe into a table. I have two programs: the first program creates the named pipe, waits for a client and writes the text file into the named pipe. the second program is doing the db2Load() call.
3
5028
by: a | last post by:
Hi everybody, Is it possible to open a named pipe from a php script on Windows? More specifically, I have a Windows service that receives commands through a named pipe, and I'd like to open the client end of the pipe directly from php rather than creating an intermediate process. Thanks,
20
10866
by: Joel Hedlund | last post by:
Hi all! I use python for writing terminal applications and I have been bothered by how hard it seems to be to determine the terminal size. What is the best way of doing this? At the end I've included a code snippet from Chuck Blake 'ls' app in python. It seems to do the job just fine on my comp, but regrettably, I'm not sassy enough to wrap my head around the fine grain details on this one. How cross-platform is this? Is there a more...
14
1975
by: Paul H | last post by:
I have been approached by a new customer to "sort-out" their existing database. They occasionally need to remotely access the database and are using Terminal Server to do so. The weird thing is that all of the local users are using TS as well to save on Access licences! Two questions: If 20 people use TS to access a database do you need an Access licence for each user?
3
3261
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual Studio 2005 SP1 and had it working perfectly on my Windows XP machine on SQL Server 2005 Express. I decided to publish this application to a test development server (with both the SQL and IIS servers on the same box) running on: Windows Server...
3
5037
by: DBC User | last post by:
Hi all, I would like to know is there a way to find out if any named pipes are running in a box. How can I go about doing that? Or is there a way to find out if a particular named pipe already running? Thanks
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.