473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get return value from a spawned process?

Hi,

I have the following scenarios: client/server programs implemented with
winsock are installed on all systems inthe network (assume it contains s1,
s2, and s3, and other systems). If I send a command from s0 client to s1
server, which ask s1 server to execute a command line of s1 client to talk
with s2 server, s2 server will return value (error code in my case) to s1
client. My question is how I can get the returned value on s0?

The command line execution on s1 is realized by calling system(), to which I
pass the client program name (the client program will returns error code),
and the processed data from s0, but system() only return -1 or 0 to indicate
error or succeed. I also looked at CreateProcess(), but still couldn't see
how I can get the returned value from client execution.

Anybody got idea?

Thanks,
Peter
Jul 22 '05 #1
1 1979
"Peter" <yb***@yahoo.com> wrote...
I have the following scenarios: client/server programs implemented with
winsock are installed on all systems inthe network (assume it contains s1,
s2, and s3, and other systems). If I send a command from s0 client to s1
server, which ask s1 server to execute a command line of s1 client to talk
with s2 server, s2 server will return value (error code in my case) to s1
client. My question is how I can get the returned value on s0?

The command line execution on s1 is realized by calling system(), to which I pass the client program name (the client program will returns error code),
and the processed data from s0, but system() only return -1 or 0 to indicate error or succeed. I also looked at CreateProcess(), but still couldn't see
how I can get the returned value from client execution.

Anybody got idea?


Since we can only suggest solutions that are or can be written in the
Standard C++, my only suggestion is to create a file with all the return
codes you want.

The rest is off-topic.

Victor
Jul 22 '05 #2

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

Similar topics

11
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new...
6
by: news.microsoft.com | last post by:
I have a very multi-threaded Windows Forms application. There are many BeginInvoke calls, as well as Thread/ThreadStarts. My issue is that when I quit my application there are often threads...
6
by: Zeya | last post by:
I am developing a ASP.Net(Web) based deployment tool, which requires XCOPY functionality. Here is the code for the method: public static int ExecuteProcess ( string ProcessName, string...
4
by: Kevin | last post by:
I have an application that handles datascraping with a TN3270 session. The TN3270 session is opened with a .ws profile and pcomstrt.exe. The process string in the application is this: psSession...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a C# application in which I start another process which produces output to stdout and stderr. In fact, that process is the uSoft VS2005 C/C++ compiler itself! I would like to...
1
by: Vishal Sethia | last post by:
Just trying to understand the behaviour of spawn. Consider I have a function which creates two threads. And in one of the threads I make a call to pexpect.spawn. spawn would fork and create a new...
0
by: loorthu | last post by:
I am noticing that pexpect kills any child that it is spawned when the parent is terminated using SIGINT (e.g Ctrl-C on the shell), but not when it is killed by SIGKILL (e.g 'kill -9' on the parent...
2
by: subrahmanya | last post by:
Hi All Does any one has idea about how to set stdout and stderr to a spawned process? I don't want to have all the handles of the parent process in the child process but I want only one of it...
4
by: A Nonymous | last post by:
I am trying to implement a web updater for my C# application. I am using a technique I have used for several years in Win32 apps but it isn't working for the .NET version of my app. This is my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...

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.