}
// create the client
// We create the client with a buffer with lenght equals witn MAX_DATA +
// 424 ( max header length)
OncRpcClient client = null;
if (protocol == Protocol.UDP) {
client = new OncRpcUdpClient(host, NFS_PROGRAM, NFS_VERSION, port, MAX_DATA + HEADER_DATA);
} else if (protocol == Protocol.TCP) {
client = new OncRpcTcpClient(host, NFS_PROGRAM, NFS_VERSION, port, MAX_DATA + HEADER_DATA);
} else {
// TODO Do something
}
client.setTimeout(10000);
if (uid != -1 && gid != -1) {
client.setAuth(new OncRpcClientAuthUnix("test", uid, gid));
}
return client;
}