sockets and connecting to other programs

J

John P

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
 
M

Mike Wahler

John P said:
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
 
C

CBFalconer

John said:
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.
 
D

Dave Thompson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top