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

socket programming in c

P: 3
hello friends,
I need your help in regards with socket programming in c.
If anybody knows it plz help me out.
you have to write a program for a TCP client.
the problem is to to write a program that will do follwing stuff...

1. Take a server hostname and a port number as command-line arguments.
( Your client must resolve the hostname into an IP address.)
2. Connect to the server at the given hostname and port using TCP.
3. Print the IP address and port of the server.
4. Ask the user for a simple arithmetic expression to calculate.
(The user prompt must contain instructions for the user, including the proper format of the arithmetic)
expression and the sentinel value that will be used to indicate that the user wishes to quit.
5. Send the expression to the server.
6. Read the answer from the server.
7. Display the answer to the user.
8. Repeat the steps 4-7 until the user enters the sentinel value given in the user prompt.
When the user entersthe sentinel, the client must close the connection to the server and quit.

thanking you in advance,
srp8982
Sep 18 '06 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
C does not support sockets.

However there are many libraries round written in C that support sockets on various platforms.

Unfortunately since you haven't said what platform you are programming and which library you might be using we can't tell which of these libraries is applicable to you and are therefore unable to help you.
Sep 18 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.