#include "../include/CL.h"
#include "../include/command.h"
#include "../include/utility.h"
#include "../include/cond_comp.h"
#include <arpa/inet.h>
Go to the source code of this file.
Functions | |
void | mode_2 (int sock, string file_name, string new_file_name, int delay) |
mode 2 execution |
void mode_2 | ( | int | sock, | |
string | file_name, | |||
string | new_file_name, | |||
int | delay | |||
) |
mode 2 execution
the client will request a reg_notification on the specified file... when will be notified, will try to transfer the file, this will happen until the file is successfully transfered, at the end of transfer an end_file_transfer message will be sent to the DF
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_2.cpp.
References ERR_FILE_NOT_EXISTS, ERR_NO_NOTIFICATION, ERR_TOO_MANY_CLIENTS, get_FS_info(), init_sd_cli(), INT_AS_STRING_BYTES, FS_info_struct::ip_address, LOG, notify, OK, FS_info_struct::port, receive_command(), receive_sft_reply(), reg_notification, reply_command(), send_command(), send_end_command(), and transfer_file().
Referenced by main().