Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Client/Server Programming

Posted on 2004-10-03
5
Medium Priority
?
184 Views
Last Modified: 2010-04-01
This is my first Client/Server Program that I've written... OK, I haven't really
started yet... but, I am having trouble understanding how this works....

1) I write a Client program in C++

2) I have my computer connected to the internet... like I have Netzero running...

3) I execute my Client program

4) My program will  connect to the Server (my instructors computer) because of the code written in the program?

It seems really weird that the code I write in C++ will cause my computer to connect
with my instructors computer...just by executing the program...

Is that how it works????

side note: I'm taking an internet class which is why I'm missing this most fundamental piece of information...
0
Comment
Question by:bjw5d6
5 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12211931
Maybe if you post your client program, we can explain it more detailed. But generally speaking, it is relatively easy to code a client program with some specialized functions.
This is done usually with functions of the 'socket' library, it provides functions to connect to an specific server, by name or by IP address, send some data and receive data.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12211955
Here are good tutorials of client programming with socket library:
http://www.codeproject.com/internet/winsockintro02.asp
http://www.codeproject.com/internet/server_client_sockets.asp
More examples for Visual C++ at:
http://www.codeproject.com/internet
0
 
LVL 86

Expert Comment

by:jkr
ID: 12212376
0
 
LVL 15

Accepted Solution

by:
efn earned 2000 total points
ID: 12212439
To answer your question, yes, that's how it works.

It's not any weirder than your web browser connecting to the Experts Exchange server so you could post this question.  The same communication functions that the web browser uses are available to you as a C++ programmer.  You have the power!
0
 

Author Comment

by:bjw5d6
ID: 12231594
Thanks,  efn, for letting me know I had the power.  I finished my program and it worked.  I had no idea C++ could do that.  Thanks jkr and jaime_olivares for your responses and weblinks, they helped too. Sorry it took so long to respond... I'm new to this.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

877 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