socket programming in c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • srp8982
    New Member
    • Sep 2006
    • 3

    #1

    socket programming in c

    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
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    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.

    Comment

    Working...