poco-libraries

How to cross compile into ARM9 board? [duplicate]

你说的曾经没有我的故事 提交于 2020-01-07 04:14:26
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Building ARM GNU Cross compiler I am using POCO c++ library to implement my project in ubuntu environment. And I want to cross compile into the ARM9 based board from my POCO c++ code. How to cross compile it for ARM9? 回答1: Get a cross compiler for your target. Then take one of the cross-build configurations in $POCO_BASE/build/config (ARM-Linux, DigiEL, Angstrom, ELDK, etc.), copy it and make the necessary

How to exchange code for token in Spotify using Poco Net Library

喜你入骨 提交于 2020-01-07 02:58:08
问题 So all of a sudden they decide I need an authorization header for Spotify Search API. My application runs in C++ using Poco Net libraries and I can't get it to work. I went through all that process of getting the "code" that I am supposed to exchange for the token. I assume this code is valid, even though I used just a totally unrelated domain then copied it of the variable that was sent to that page. See https://developer.spotify.com/web-api/authorization-guide/ This is my code that isn't

How can I use a static C++ method as a callback for a Poco timer?

人走茶凉 提交于 2020-01-06 05:25:36
问题 Particularly I'm talking about the constructor of this Poco class: Poco.TimerCallback I would like to use it in legacy C++ code where most of the classes I've written are "static" so that they only contain static methods and no constructors, just because I won't need multiple instances of such objects anyway, and the classes are merely for encapsulation. Well yeah, the Poco guys suggest to add a callback method like this: TimerCallback<MyClass> callback(*this, &MyClass::onTimer); timer.start

How to send websocket PONG response using POCO

偶尔善良 提交于 2020-01-03 16:59:14
问题 I am trying to set up a websocket server using POCO 1.7.5. The sample from POCO found here works well. Lines 111-122 reads (sligthly prettified): WebSocket ws(request, response); char buffer[1024]; int n, flags; do { n = ws.receiveFrame(buffer, sizeof(buffer), flags); ws.sendFrame(buffer, n, flags); } while (n > 0 && (flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE); However, this approach does not take care of answering ping frames by pong frames. How do I do this properly

Poco c++Net: Http get headers from response

╄→гoц情女王★ 提交于 2020-01-03 16:55:51
问题 Im using POCO C++ Net libraries for http I want to try make a strategy for persistent caching. First of all I think I need to get expires from the cache headers and cross check with cached values (please tell me if I'm wrong). So how can I extract the cache header from httpResponse ? I've seen that you can do this in Java, (getFirstHeader()), but how do I do it in POCO C++? Below is an ordinary http GET-request using POCO: try { // prepare session URI uri("http://www.google.se");

Load image from URL in C++

六眼飞鱼酱① 提交于 2020-01-02 12:58:32
问题 I am using C++ and OpenCV and I'd like to load an image from password protected URL. I succeeded in loading image from URL using idea of this link which uses POCO library, but I do not know what should I do when I have to use username and password in order to access the URL. 回答1: I'd say do what @StevenV said and try to encode the credentials in the URI. If that doesn't work or you don't want to use that method you have to use the POCO HTTPClientSession class instead. Something like this: URI

HttpRequest PUT content in poco library

China☆狼群 提交于 2020-01-02 02:43:10
问题 I want to send some data from a C++ application to a server using a HTTP PUT request. I am using poco library for networking in my application. I am using this code snippet: HTTPClientSession session(_uri.getHost(), _uri.getPort()); HTTPRequest req(HTTPRequest::HTTP_PUT, path, HTTPMessage::HTTP_1_1); Where do I set the content (file) stream when I send the request? Can anyone show me an example using this library? 回答1: Quoting the online documentation for HTTPClientSession : sendRequest()

poco c++ static linking problems with undefined references to symbols

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 10:56:09
问题 I'm trying to link to static versions of the POCO C++ libs like this: g++ BCCMain.o -L$_POCO_LIBS -Wl,-Bstatic $_POCO_LIBS/libPocoFoundation.a $_POCO_LIBS/libPocoUtil.a $_POCO_LIBS/libPocoXML.a $_POCO_LIBS/libPocoJSON.a -Wl,-Bdynamic -o BCMain Unfortunatelly this gives errors about some undefined references to symbols like: Poco::Logger::get(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) even though Poco::Logger::get(std::string const&) actually IS defined in

Connect Websocket with Poco libraries

荒凉一梦 提交于 2020-01-01 06:11:09
问题 I am trying to connect to the Echo Test Websocket using the Poco C++ libraries. In order to do so here is my code which should set up the Websocket: HTTPClientSession cs("echo.websocket.org"); HTTPRequest request(HTTPRequest::HTTP_GET, "/ws"); HTTPResponse response; WebSocket* m_psock = new WebSocket(cs, request, response); m_psock->close(); //close immidiately However it does not work: I am getting an error message like this: Poco::Exception: WebSocket Exception: Cannot upgrade to WebSocket

How do I make an HTTP Post with HTTP Basic Authentication, using POCO?

与世无争的帅哥 提交于 2020-01-01 03:49:11
问题 I'm trying to make an HTTP Post with HTTP Basic Authentication (cleartext username and password), using POCO. I found an example of a Get and have tried to modify it, but being a rookie I think I've mangled it beyond usefulness. Anyone know how to do this? Yes, I've already seen the other SO question on this: POCO C++ - NET SSL - how to POST HTTPS request, but I can't make sense of how it is trying to implement the username and password part. I also don't understand the use of "x-www-form