I am posting part of the code from client side.
Client makes socket and connects to server
-----------------------------------------------------------------------------------------------------------------
Code:
gettimeofday(&tv1,NULL);
if(send(sock,echoString,echoStringLen,0) != echoStringLen) //sending starts here
printf(" send failed ");
totalBytesRcvd =0;
printf("Received: ");
int recv_count=0;
while(totalBytesRcvd < echoStringLen)
{
if((bytesRcvd=recv(sock,echoBuffer,RCVBUFSIZE-1,0))<=0) //receiving from server
printf("received failed ");
printf("bytes received = %d \n",bytesRcvd);
totalBytesRcvd += bytesRcvd;
echoBuffer[bytesRcvd]='\0';
puts(echoBuffer);
recv_count++;
}
gettimeofday(&tv2,NULL);
totalT=(tv2.tv_sec-tv1.tv_sec)+(tv2.tv_usec-tv1.tv_usec);
printf("recv count = %d and time taken = %ld microseconds \n",recv_count,totalT);
----------------------------------------------------------------------------------------------------------------------
thanks