The FastDFS client can help us easily connect to the DFS server and send encapsulated SOCKET commands to the server. DFS only provides the server in the linux environment, but does not support WINDOWS. net, you can choose C # FastDFS client, you can complete it according to your own needs.
My Transformation:
For ease of calling, I put the work connected to tracker on the DFS client and assigned it a default group.
Constructors List<IPEndPoint> trackerIPs = List<IPEndPoint> = List<IPEndPoint>= =
For the start user, you can complete the upload, download, and other operations during the call, and check the Code:
[] content = = FileStream( (BinaryReader reader = = reader.ReadBytes(( fileName = FastDFSClient.UploadFile(FastDFSClient.DefaultGroup, content,
Below I will disclose the source code of the FastDFSClient class. After reading the code, I will discuss the problem and solve it together.
Constructors List<IPEndPoint> trackerIPs = List<IPEndPoint> = List<IPEndPoint>= = StorageNode GetStorageNode(== = = === UploadFile(StorageNode storageNode, [] contentByte, == UploadSlaveFile( groupName, [] contentByte, master_filename, prefix_name, == = == UploadAppenderFile(StorageNode storageNode, [] contentByte, == AppendFile( groupName, fileName, == = = RemoveFile( groupName, == = = [] DownloadFile(StorageNode storageNode, = DOWNLOAD_FILE.Instance.GetRequest(storageNode.EndPoint, , = [] DownloadFile(StorageNode storageNode, fileName, offset, == FDFSFileInfo GetFileInfo(StorageNode storageNode, ==