I'm trying to write a C++ command line program for peer-to-peer file transfer. My idea is to establish a connection with another machine, and send file data directly. My target platform is Windows, but interoperability with Linux and MacOS would be nice. I want this program to be standalone and not require a web browser.
I did some research and it seems that WebRTC would fit the bill, but I can't find much information on using it with C++.
Is it possible to build a standalone executable that utilizes WebRTC without requiring users to download any dependencies in order to use my program?
As the name suggests - to have the "RTC", it requires "Web" component, either in form of browser or a library.
The C++ library is quite huge and it's not a trivial task to understand and write it in a short period. Browser provides APIs in form of JavaScript calls, which are relatively easier to implement.
There might be commercial APIs in C++ available over internet.
I'm trying to make an application which sends a directory which contains a tree of files/directories from one computer to another one.
I've searched but I couldn't find much. Is there any ready function?
How do I to proceed with this please?
Thanks a lot !
EDIT:
OS: Windows 7 SP1.
IDE: VS2013.
I think using FTP can be a good method.
WinInet and libcurl have function relative FTP.
Many developers have been recommanding using libcurl rather than using WinInet.
However, it depends complexity and scale of your application.
The by far easiest would be to use a network share resp. share a directory on the target computer. That would work with *nix systems as well, using Samba. If that's possible the operation boils down to simple file system copies. If that's not possible:
I think you must create an archive of the directory tree before you can send it through a network connection. You could call that serializing. .NET 4.5 has built-in support for creating zip files, cf. http://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive%28v=vs.110%29.aspx.
How to traverse a dorectory tree is shown in http://msdn.microsoft.com/en-us/library/07wt70x2%28v=vs.110%29.aspx.
How to use FTP programmatically is shown in http://msdn.microsoft.com/en-us/library/ms229715%28v=vs.110%29.aspx. But you'll need a running FTP server on the remote machine.
The remaining problem is how to unzip the file at the destination. For that you'll need a logon.
We manage an legacy system from the early 80s. It is awkward to access the file system on it, and we're therefore thinking on methods to work with the files from Windows.
We have looked at two methods for doing this:
Create a user space file system (eg with Callback File System).
Looks to me like the best solution, but it is expensive
Create a CIFS/SMB server to share the files on the network and mount using "net use"
I'm not sure if this option even is possible
I have not found any good examples of how I write an SMB server. Maybe there's a reason for that?
My questions are:
Is the method two possible?
Is it possible to mount a CIFS/SMB share locally if there is no network connection?
What are the pros and cons of the two methods?
Edit
The legacy system runs under Windows in a house developed emulator (which works in much the same way as VMware). It is in this emulator we want to expand the functionality to distribute the file system in the legacy system to Windows.
The legacy system is totally unique. Both the operating system and file system is house developed (and very odd).
So I have some specific environment (like linux os based phone) so I have no such thing like terminal. All I can do is create my own UI's using C++ and some SDK I am provided with.
I want to create an ssh client application for my device. Its not a work, nor a homework - just for fun that means I have lots of time for solving conflicts that may appear.
My main problem is I have never worked with OpenSSH as a lib... and when I look on it it seems some large mountain to me.
So I ask for your help - have you seen any open-source ssh clients that use SSH methods with their own UI's based on OpenSSH or, better Portable OpenSSH?
PuTTY for example.
I have to program a C/C++ application. I have windows and linux (ubuntu 9.04) in my machine, and can program in both of them (via gcc/code blocks/vim,etc). The problem is that the executable is going to be run in a Unix (not linux) machine (will have access to it in about 20 days).
My Team Leader doesn´t want all of the code to be programmed in linux - unix. So, some of it will have to be developed in windows (and then many prayers will follow so that nothing bad happens).
The best thing i´ve come up with is to program remotely on the server, from windows and linux, so every programmer (only me for the next 2 weeks) is sort of happy.
In windows, I think i´m stuck with putty, but is there any alternative on linux, rather than ssh-vim? .
I read this Remote debugging with Eclipse CDT but it didn´t bring much light on the subject. At least not much hope.
There is another issue. I don´t consider C/C++ to be a portable language. At least for real programs. Sure it compiles, but many issues will arise, even with boost / stl. I haven´t taken a careful look to the code, but still, how wrong a I?
Any tips will be greatly appreciated.
Thanks in advance.
You could ssh w/ xming for a gui ide/editor that is on the remote machine.
If all the code is one the remote machine and compiled there, don't you have to worry about developers trying to work with the same resources? Also might the machine/network not be able to handle multiple ssh connections if you're using xming?
If you can convince your system administrator to install the libraries (an X server is not required), you can use X forwarding with SSH, which will allow you to execute X apps remotely and have them come up on your local server. If you're using Linux locally, you probably have X running already, and if you are using Windows, you can use the Xming server (with a little configuration to get it to accept remote connections). For debugging, if you need a separate shell, just set another instance of SSH going and perform debugging from another process.
As for portability, it depends on what you are trying to do. If all you want is a simple console-based application, you shouldn't run into any major portability concerns. If you are using more complex code, portability depends heavily on two things. The first is the choice of libraries - sure, you can run applications written for Win32 on Linux with Wine or actually compile them with Winelib, but it's not a pleasant experience. If you choose something more portable like Qt or gtkmm, you'll have a much easier time of things. Likewise for filesystem code - using a library like Boost.Filesystem will make things significantly simpler. The second thing that makes a big difference for portability is to follow the documentation. It's hard to stress this enough - many things that you do incorrectly will have varied results on different platforms, especially if you are using libraries that don't do checks (note: I highly recommend checking code against debug standard libraries for this reason). I once spent nearly a weak tracking down a portability bug that arose because someone didn't read the docs and was passing an invalid parameter.
If you want to use remote desktop like facility try VNC www.realvnc.com
or in case its just a remote login Hummingbird, EXceed could help
You might want to check the wingdb visual studio extension.
Not sure if this will help, but take a peek at sshfs. I haven't had a need to use it myself, but I have read others use it to access remote files and directories via ssh and work on the files locally. I presume you could access your remote home directory via sshfs and then use your local tools to work on the source files. I would very interested in knowing if this works out, so please post back if you give it a shot.
I use No Machine NX, which gives you the entire desktop of the remote machine. It also has a Windows client. I work remotely from home on Fridays, so I'm using it right now. You'll have to install it on the remote machine, and then install a client on your Windows or Linux machine.