SciDB C++ (Windows) Connection using Protocol Buffers - c++

I am trying to connect my scidb server directly via sockets using C++ under windows environment (Winsock2).
I could only find a python example below for the above purpose which seems quite outdated.
https://github.com/artyom-smirnov/scidb4py
The .proto file shipped with the SciDB 14.12 and the one used in the python example are very much different so the example does not work with the SciDB 14.12.
If someone could help me with preferably a C++ (Windows/Linux) working example or update the existing python example.
Atleast if someone could guide me to the documentation part which explains how to use the message format outlined in the .proto file and what to expect in return.
Thanks.

I believe what you may be looking for is https://github.com/Paradigm4/shim.
It is a HTTP API for SciDB. All you have to do is to install this together with your SciDB. You would then use directly your Winsock (or a HTTP protocol library) directly in C/C++, connecting to the SHIM instance.

Related

How to use WebRTC in a C++ application?

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.

signal/Textsecure bindings for c/c++?

I am trying to create a signal/textsecure client using qt and C++, however i cant seem to fibd any C++ bindings for it.
the only bindings i can find are for Go (https://github.com/nanu-c/textsecure/)
is there any way to connect C++ with signal?
edit:
i wanted to clarify some things:
-im talking about the messaging app called Signal (https://signal.org)
-i am trying to write an app for ubuntu touch and am developing on manjaro linux.
On Linux or Unix, you probably want to communicate with other remote applications using some communication protocol, such as HTTP or HTTPS or SOAP or JSONRPC or ONCRPC. Of course read about socket(7) and before that Advanced Linux Programming then about syscalls(2). Consider reading a textbook on Operating Systems
Be sure to study the source code related to Signal. Read their technical documentation.
You surely need to understand the details. So take a few days or weeks to read more about them.
If you want to use some web service, you need to read and understand its documentation and when and how you are allowed to use it. There could be legal or financial issues.
Then you might use HTTP related libraries (e.g. Wt or libonion server side, and libcurl or curlpp client side).
See also in April 2020 the ongoing HelpCovid free software project (for Linux), at least for inspiration. We are coding it in C++.
after a little more digging i found that textsecure bindings are now renamed to libsignal.
after finding that out i found a lib for c/c++
https://github.com/signalapp/libsignal-protocol-c

how to make remote calls using IIOP and omniORB

I have installed omniORB successfully on Windows Server 2012. I have two IDL files which I compiled using the omniidl compiler and now have a header file and source file for the two IDL files.
How do you go about writing a client that can connect remotely and make the fuction calls in C++? How does this process work?
I ordered the book "Advanced CORBA Programming with C++" which should be here soon, however, if anyone has experience with writing IIOP clients in C++ if you could explain how the connection is made and making a simple call. I am only making the client as the device already has the iiop server.
I would put this as a comment but I don't have enough rep. If you are working with a cisco DCM (or any cisco product) I would recommend reaching out to cisco.
Just recently I have made a python implementation of CORBA (omniORBpy) with a cisco DCM. I reached out to cisco and they gave me code that made the connection with some examples of method calls as well.
Alternatively omniORB does have some examples showing how to connect a client and server and pass information to each other. See the omniorb documentation. Under chapter 2 "The Basics" they have a few walk throughs.
Hopefully this helps in some way.

how to send one directory using Socket in C++?

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.

Download a file from the web in C++ without using non-standard libraries on Linux

When I say non-standard libraries, I am referring to things like Boost, libCurl and anything else that may be able to do this far easier than standard C++ can. The reason for this is that I am writing an application as a piece of coursework (the class is dedicated to C++) and I am required to use only standard libraries and functions.
I am looking to download a RSS file, using a URL that the user will supply (I'm building a rudimentary RSS client), and the biggest problem I'm facing is that I'm not sure how to get the file down. Once I get past that bit, parsing it for the xml tags and displaying the content will be relatively straightforward. I've been looking around and I've only found solutions that say to use non-standard libraries, usually libCurl. If someome could just give me a quick heads up about what I should be looking at for this, then I'd be grateful.
Also, if you think you're helping me cheat, you're not. The assignment is to build an application of our choice and we're being graded on our use of the various feature of the language (it must contain so many classes, use these variables types, etc).
Check out Beej's Guide to Network Programming for a quick but excellent introduction to sockets. If you cannot use any non-standard libraries, your only option is to manually connect on port 80 and make the request yourself.
Assuming even a beginner-level knowledge of C++, that should be all you need.
First off, it can't be done using only standard C++. There is no network interface in either standard C++ or standard C.
If you're required to take a "do-it-yourself" approach, then probably the intention is that you would use your platform's sockets API. In the case of linux, this is part of the POSIX standard, not C++, and is available from <sys/socket.h>.
The basic procedure is: parse the URL; look up the IP address of the domain; create a socket; connect the socket; write an HTTP request to the socket; read the HTTP response back from the socket; clean up.
Obviously, an HTTP library is far more convenient, especially since an HTTP download can get more complicated than what I describe above (for example, if the server responds with a redirect). Pretty much all linux distributions will provide libcurl, and/or the curl and wget programs.
Writing a program to make a socket connection is relatively trivial.
http://www.linuxhowtos.org/C_C++/socket.htm
Now that you have a socket open to an HTTP server you need to understand how to ask for a document and how to decode the reply:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html
Basically you need to send:
GET<SP><URL><SP>HTTP/1.1<CRLF>
Where:
SP: Single Space
CRLF: \r\n
URL: The Full URL of the page including the server name.
What you get back will be
http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6
HTTP/1.1<SP>200<SP>OK<CRLF>
(<Header><CRLF>)*
<CRLF>
<Document>
The above means:
The first line is the response line that should contain 200 OK.
If it does not then there is some kind of error and you should just give up.
This is followed by 0 or more header lines
Just ignore these lines
There will be 1 empty line to mark the end of the headers.
Then the document will be on the stream.
If you really want to do it without using libcurl you can always open a tcp socket and then send:
GET /myurl
(http 1.0 or preferably use http 1.1)
Basically you're writing a very simple http protocol client implementation.
You can download source code for wget standard utility
Since you are not allowed to use non-standard libraries, you could write your own primitive wrapper class for the linux "curl" command (I'm assuming you are using linux). Curl is a very powerful command, and it can probably do what you need it to.