[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

client-server demo

Posted on 2000-04-07
1
Medium Priority
?
227 Views
Last Modified: 2010-04-15
I need to write a simple tcp/ip client-server application where the client gets the server address and an exec to run as parameters and sends the exec to the server which runs itand returns the exit status of the exec.
if someone can give me a simple code to start with i'm sure to be able to continue from there.
oh and the server and client suppose to work on both unix and win95 (i was told it is different).
0
Comment
Question by:katzgal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
munsie earned 200 total points
ID: 2695214
this almost sounds like a school assignment....

anyway for some pointers, since that is what you are looking for, go grab a copy of Unix Network Programming Vol 1 by Richard W. Stevens.

A few pointers on making your source code work under Unix and Windows:

1. Unix uses ints for socket descriptors, Windows uses the SOCKET type:

so do the following:

#if defined unix
typedef SOCKET int;
#endif

2. Unix allows you to use read() and write() on a socket, Windows does not.

so, just use recv() and send()

3. Windows use WSGetLastError() to return errors, Unix uses errno.

again you can just define a macro:

#if defined unix
#define WSGetLastError() errno
#endif

that should cover most of the differences.  Look in the Visual C++ documentation for more info, but for simple TCP networking that should cover it.

i haven't found any books that cover both Unix and Windows networking, but the Unix Network Programming book will give you enough background in Unix to make the transition to Windows fairly easy.

good luck,
dennis
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question