class CAVERNnet_remoteFileIOServer64_c

This class acts as a server for performing remote upload and download of files

Public Fields

static const int DEFAULT_PORT
Default port number to listen on
static const int THREADED
Create a thread to handle each client request.
static const int NON_THREADED
Do not create a thread to handle each client request.

Public Methods

int init (int inPort=CAVERNnet_remoteFileIOServer64_c::DEFAULT_PORT, char* neighborServer = NULL, int neighborPort = CAVERNnet_remoteFileIOServer64_c::DEFAULT_PORT, int storeLocally = 1)
Initialize server
void process (int threaded = CAVERNnet_remoteFileIOServer64_c::NON_THREADED)
Check for incoming requests

Documentation

This class acts as a server for performing remote upload and download of files. First call the init() call and then inside a while loop call checkForNewRequests(). Use CAVERNnet_remoteFileIOClient_c to connect to this server and perform the upload and download operations.

Note: currently there exists a strange behavior in threads that causes the network I/O to improperly complete. Hence checkForNewRequests() currently does not create a new thread for each client that makes an IO request. All clients must wait in line.

static const int DEFAULT_PORT
Default port number to listen on. Default is 8000.

int init(int inPort=CAVERNnet_remoteFileIOServer64_c::DEFAULT_PORT, char* neighborServer = NULL, int neighborPort = CAVERNnet_remoteFileIOServer64_c::DEFAULT_PORT, int storeLocally = 1)
Initialize server
Returns:
FAILED(FAILED = 0) if init() failed, OK(OK = 1) if successful
Parameters:
inPort - The local port number to listen on (default is 8000)
neighborServer - This should be a valid internet address of a host you want to connect to if files are not present on the local server
neighborPort - This is the remote port number (default is 8000)
storeLocally - storeLocally 0 means that the file downloaded from the neighborServer will not be saved locally; 1 means that it is saved. By default this parameter is 1.

void process(int threaded = CAVERNnet_remoteFileIOServer64_c::NON_THREADED)
Check for incoming requests. Recommend doing this in a while loop.
Parameters:
threaded - set this to THREADED or NON_THREADED. Default is NON_THREADED. Setting it to non-threaded will mean each request is processed sequentially so any pending requests must wait in the queue. Setting it to threaded means each incoming request spawns a thread to handle the request.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de