src_CL/CL_mode_1.cpp File Reference

#include "../include/CL.h"
#include "../include/command.h"
#include "../include/utility.h"
#include "../include/cond_comp.h"
#include <arpa/inet.h>

Include dependency graph for CL_mode_1.cpp:

Go to the source code of this file.

Functions

void mode_1 (int sock, string file_name, string new_file_name, int delay)
 mode 1 execution


Function Documentation

void mode_1 ( int  sock,
string  file_name,
string  new_file_name,
int  delay 
)

mode 1 execution

the client will request a start_file_transfer on the specified file, transfer the file, and signal the end of transfer... all of this will happen in an infinite cycle, so the client will need to be interrupted manually (if no error occours)

Parameters:
sock | socket of the client connected to the DFR
file_name | the file the client wants from a FS
new_file_name | the future name of the obtained file
delay | this enables the programmer to test the DFR better, it is used only if the TEST macro has been defined in compilation phase, but must be always specified

Definition at line 9 of file CL_mode_1.cpp.

References ERR_FILE_NOT_EXISTS, ERR_TOO_MANY_CLIENTS, get_FS_info(), init_sd_cli(), INT_AS_STRING_BYTES, FS_info_struct::ip_address, LOG, OK, FS_info_struct::port, send_command(), send_end_command(), start_file_transfer, and transfer_file().

Referenced by main().


Generated on Sat Jun 13 21:06:30 2009 for DistributedFileRepository by  doxygen 1.5.8