MY client and server need to achieve the following requirements:
1.1. program for client needs to take two arguments that specify the name of server and the port that it is trying to connect to. Your program for server needs to take an argument that specifies the port that it is listening to.
2.2. server will start first and keep listening to the specified port. Your client will connect to the port that your server is listening to, and a socket between your client and server is constructed.
4.3. client will first prompt a welcome message that asks the user to enter a username using the keyboard. This username will then be sent to the server. Then, your server, after receiving the username from your client, will send an acknowledgment message to the client.
6.4. client, after receiving the acknowledgment message from your server, will prompt a message that asks the user to enter the corresponding password. This password will then be sent to the server. Then, your server, after receiving the password from your client, will verify the received pair of username and password against the list of legitimate pairs. If the result is positive, the server will send a success message to the client. If the result is negative, the server will send a failure message to the client.
8.5. client, after receiving the result message, will print out the result and close the socket. Your server will close the socket following the client, and keep listening for the next client request.
Last edited by saiful_911; 07-28-2010 at 01:18 AM..
Please take your time to check your posts for spelling errors. You might be time-pressed typing, but that way it takes us longer to understand what you're trying to tell us. This goes especially for "leetspeak".
Your requirements don't go beyond any other random socket program. Homework?
If that's not homework, search the net for "socket programming", fetch one of the (overly simplistic) examples, expand it a bit, and et voilą!
This is home work and this is client server socket program. I have to use in C program code. What I have to do.
1. client connect to the server.
2. than client will first prompt a welcome message that asks the user to enter a username using the keyboard. This username will then be sent to the server.
3. than server, after receiving the username from client, it will send an acknowledgment message to the client.
4. client, after receiving the acknowledgment message from server, it will prompt a message that asks the user to enter the corresponding password.
5. This password will then be sent to the server. after receiving the password from client, will verify the received username and password. If the result is positive, the server will send a success message to the client. If the result is negative, the server will send a failure message to the client.
5.client, after receiving the result message, will print out the result and close the socket. server will close the socket following the client, and keep listening for the next client request.
This is the scenario of the program. kindly please help me to solve this program.
Here I can connnect client and server but the rest of work I can not. My code is below.
Client code is
Server code is
thanks
Last edited by pludi; 07-28-2010 at 10:27 AM..
Reason: code tags, please...
I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Hi All,
For listing large files i am using the following command
find /XYZ/ -xdev -size +100000 |xargs ls -l |sort -nr -k 5..And my question is i am getting more number of files with this, so not able to copy those, how can I get those all in page by page , so that I can able to copy those... (4 Replies)
Hi,
I have initailized a varaible EBID as typeset Long EBID=0
i am calculating value of EBID using certian formula as below:
(( CURR_EBID= ($BANDINDEX << 27) | ($CURR_FREQ << 16) | ($CURR_CELLID << 4) | $CURR_SECTOR_VALUE ))
return $CURR_EBID
The output is as below:
+ (( CURR_EBID=... (6 Replies)
Hi friends,
I am new to UNIX.
I going to transfer files using SFTP. I am writing a script and using mget .
If i am using mget * means,
if all the files and their sub directories are transferred or not?
If suppose , the local system dose not have the sub directory then what will... (1 Reply)
i want shell script program for counting the no of times the given input word is occured in the given input file.i am unable to do this .i got some of output with awk but i need it completely with shell script program
i am waiting for the solution (4 Replies)
I have a file like this I have to
I have input file this , I want to give the out put in the below
input file
(NARAYANA 1 ENDING AT (100, 16383)
,NARAYANA 2 ENDING AT (100, 32766)
,NARAYANA 3 ENDING AT (100, 49149)
,NARAYANA 4 ENDING AT (100, 65535)
,NARAYANA 5... (8 Replies)
Hi!
How to use awk command and set command in a shell script?
Suppose I have to fetch data from a file and change one data with another one.Say data is ABCD.Now I have to change C with X .How do I solve this one? (2 Replies)
Hi,
In my current directory, i have the following files:
x1.dat
x2.dat.gz
x3.dat
I want to use the find command and display only files which has *.dat and NOT *.gz extension files.
Please help me out.
Thanks,
Kris Kart. (2 Replies)
guys i have sun solaries 8 under intel .. i added a new D-LINK ethernet and i need to see if the computer define it or not .. so i need to make reconfiguraion ..
what was the command ... for reconfiguration ???
thanks alot (3 Replies)