By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,304 Members | 3,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,304 IT Pros & Developers. It's quick & easy.

sockets and connecting to other programs

P: n/a
Hi,

I know that some older Unix programs that compile with GCC use socket.h to
connect to and execute other programs. However, I am using Visual C++ 6.0
and it doesn't seem to have socket.h included. Is there any standard
cross-platform way (ie can compile in both Visual C++ 6 and GCC) to execute
and connect to other programs?

Thanks,
John P
Nov 14 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"John P" <jo*****@gmail.com> wrote in message
news:ct***********@agate.berkeley.edu...
Hi,

I know that some older Unix programs that compile with GCC use socket.h to
connect to and execute other programs. However, I am using Visual C++ 6.0
and it doesn't seem to have socket.h included. Is there any standard
cross-platform way (ie can compile in both Visual C++ 6 and GCC) to execute and connect to other programs?


The portable standard C language (the topic here) does
not provide any networking features. However, there do
exist portable libraries for them. www.google.com

-Mike
Nov 14 '05 #2

P: n/a
John P wrote:

I know that some older Unix programs that compile with GCC use
socket.h to connect to and execute other programs. However, I
am using Visual C++ 6.0 and it doesn't seem to have socket.h
included. Is there any standard cross-platform way (ie can
compile in both Visual C++ 6 and GCC) to execute and connect
to other programs?


How should we know? None of sockets, Visual-C++, Gcc are mentioned
in either the C90 or the C99 standard. Since you lusrked here and
read the faq and welcome message you are well aware that the
subject of discussion is the portable standardized C language only.

I believe that Visual C++ has been mentioned as being connected
with Microsoft and/or Windows in some manner. So you might want to
look around in newsgroups containing those names. Of course you
are also aware that C++ and C are different languages.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 14 '05 #3

P: n/a
On Sun, 30 Jan 2005 12:13:48 -0800, "John P" <jo*****@gmail.com>
wrote:
Hi,

I know that some older Unix programs that compile with GCC use socket.h to
connect to and execute other programs. However, I am using Visual C++ 6.0
and it doesn't seem to have socket.h included. Is there any standard
cross-platform way (ie can compile in both Visual C++ 6 and GCC) to execute
and connect to other programs?

They needn't be older and needn't be compiled with GCC; sockets using
several header files of which socket.h is only the first are standard
on all Unices regardless of compiler, and some other systems also.

Windows (since at least NT) provides a sockets interface that is
similar but not identical to Unix (Berkeley) sockets as long as you
avoid advanced(?) features like nonblocking and mixed poll(). One
right-up-front difference is that it mostly uses only a single header
file, winsock2.h, instead of the dozen or so in Berkeley.

With some care and only a few #if's you can write source that compiles
on both Unix and Windows, but you can't expect source written for Unix
and without planning for this to work on Windows. If all you want is
to run on Windows machines, you might also look at cygwin,
www.cygwin.com, which provides a Unix "emulation" layer on Windows.
That uses (a port of) GCC, not VC++.

Note that sockets (and TCP/IP) only allow to connect to remote things
and exchange data; they can't by themselves execute anything. They can
be used to send a _request_ to something typically a demon on a remote
system _asking_ it to execute something for you.

- David.Thompson1 at worldnet.att.net
Nov 14 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.