LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   client/server echo program of UDP sockets (http://www.linuxquestions.org/questions/programming-9/client-server-echo-program-of-udp-sockets-633903/)

memisbah 04-08-2008 08:56 AM

client/server echo program of UDP sockets
 
Hi!!!
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 working..im running it on fedora core7 environment. anybody who could help me n send me the code on my id memisbah@gmail.com
i require it urgently by tonight.
i'l be obliged. thanku!
waiting for help!

michaelk 04-08-2008 09:14 AM

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.

ta0kira 04-08-2008 11:27 AM

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.
ta0kira


All times are GMT -5. The time now is 03:20 AM.