1

I am building a client/server app that needs to allow for both basic messaging(Text) and file transfer, possibly including large files over a local network(IP/Port already known of both devices). I also want to be able to encrypt both of these data streams eventually.

I have looked into doing this with sockets, as well as taken a look at some open source apps that perform similar functions (with sockets). It seems there are a lot of things that can go wrong easily, and lots of common implementations. To me this seems like the perfect scenario for an open source library, and yet I can not seem to find one that is well regarded, especially for the file transfer scenario. I am looking for suggestions around that, rather than reinventing that wheel.

Preferably I could simply say on one side

HelperFunc::SendFile(fd, path/to/file);

HelperFunc::SetCallbackWhenGettingFile([](string fileNameFromSender{
saveTheFile(pathToSaveTo/fileNameFromSender)})

HelperFunc::SendMessage("Hi");

and trust that the file will go where I want it, or that messages will be delivered. When I looked at other projects implementation (embedded with the rest of the app) they would generally have a standardized message that prefaced all others noting the length of the actual message, to help get around some of the issues

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.