Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-08-2008, 07:56 AM   #1
LQ Newbie
Registered: Apr 2008
Posts: 1

Rep: Reputation: 0
client/server echo program of UDP sockets

ive completed two of my tasks but im stuck in the third one..its a modified C program of UDP client/server echo.
briefly describing my program, the server has to accept two operands and the basic mathematical operator, process them and send the result back to the client.
the program should have the following features:

-the client should first ask the status of server that whether its running or dead.
-then the server should ask for the left operand. it sholud be sent by client and it shud be acknowledged by the server through some message.
-after that the server should ask for the operator (+,-,*,/) and acknowledge it.n repeat the same process for the right operand.
-after having all the data the server should process that mathematical expression and send back the result to the client n the client should display it.

ive tried various things, like multiple recvfrom() commands but its not running it on fedora core7 environment. anybody who could help me n send me the code on my id
i require it urgently by tonight.
i'l be obliged. thanku!
waiting for help!
Old 04-08-2008, 08:14 AM   #2
Registered: Aug 2002
Posts: 16,148

Rep: Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873Reputation: 1873
1. This looks like homework which is against the forum rules. Asking for specific help is not a problem but do not ask us to do it for you.
2. Urgency on your part it not important for people who volunteer their free time to help others.
Old 04-08-2008, 10:27 AM   #3
Senior Member
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
The best way to do this is to get the IPC working with a fork and either pipe or socketpair. Once that's working, figure out how to make the connections and separate the program into 2.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
client/server question (with sockets) bicycle Programming 1 11-24-2005 01:26 PM
Sockets Programing Client/Server ashucool83 Programming 9 09-30-2005 02:43 PM
how to get client ip address at udp server cranium2004 Programming 2 03-21-2005 11:35 PM
Server Client program using UDP frostmagic Programming 9 11-14-2003 11:06 PM
Server/Client-commucation via TCP-Sockets cYbORg Programming 5 05-18-2003 06:01 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration