Thursday, 11 August 2011

File Transfer Using TCP Algorithm

File transfer TCP Algorithm 
Server side Filer Transfer TCP Algorithm





STEP 1: Start the program. 
STEP 2: Declare the variables and structure for the socket. 
STEP 3: Create a socket using socket functions 
STEP 4: The socket is binded at the specified port. 
STEP 5: Using the object the port and address are declared. 
STEP 6: After the binding is executed the file is specified. 
STEP 7: Then the file is specified. 
STEP 8: Execute the client program. 


Client File Transfer TCP programming Algorithm 



STEP 1: Start the program. 
STEP 2: Declare the variables and structure. 
STEP 3: Socket is created and connects function is executed. 
STEP 4: If the connection is successful then server sends the message. 
STEP 5: The file name that is to be transferred is specified in the client side. 
STEP 6: The contents of the file is verified from the server side. 
STEP 7: Stop the program 



use File function


fp=open(fname,”w”);
fwrite(op,strlen(op),1,fp); 



fp=fopen(fname,”r”);
fopen(op,1000,1,fp);