Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - AB

Pages: [1]
1
Network / Http error 1001 in multithreaded application
« on: November 17, 2013, 03:16:24 pm »
I'm using the Parallel Patterns Library to run several http clients in parallel in this manner:

concurrency::parallel_for_each(begin(queries), end(queries), [&](const std::pair<std::string, std::string> &p){
      try
      {
         sf::Http http("some_host_name");
         sf::Http::Request request("some_path_name" + p.second);
         auto response = http.sendRequest(request, sf::seconds(30));
         if (response.getBody().find(found_substring) != std::string::npos)
         {
            results.push(p.first);
         }
                        // some debug info gathering stuff omitted for brevity
      }
      catch (const std::exception &e)
      {
         // error handling code omitted for brevity
      }

   });


Note that both the "queries" and "results" are concurrency safe containers from the PPL.

The problem is that sometimes the above code gets stuck (it doesn't crash, just doesn't work properly). I've done some error checking and I've observed the following:
The problem is related to the SFML http client, which returns error code 1001 and times out. Once the problem occurs, the same thread will continue reporting error 1001 from its http clients. The problem takes some time to appear, usually after several thousand queries have been processed successfully.

Any tips on how I can diagnose and solve the problem?

2
Graphics / sf::Lines type and anti-aliasing
« on: July 21, 2013, 12:37:16 pm »
I'm using sf::VertexArray line(sf::Lines, 2) in my program and they appear as a "stretched" line that is wider than one pixel when anti-aliasing is turned on, whereas according to the documentation, they should always be one pixel wide.

Is there any way to have anti-aliasing turned on while avoiding the visual "stretching" of the lines?

3
Graphics / How do I extract x and y from a Vector2f?
« on: May 04, 2013, 01:02:52 pm »
sprite.getPosition() returns the x and y values of its position as Vector2f


Similarly, texture.GetSize() returns width and height as Vector2u.

I don't understand how I can extract the x and y values from Vector2f. How do I work with these?

4
General / Code::Blocks linker problems
« on: April 30, 2013, 09:47:18 am »
I've followed the instructions on http://www.sfml-dev.org/tutorials/2.0/start-cb.php but I'm getting an "undefined reference" error for every SFML in the code. I'm trying to use static libraries. What am I doing wrong?

This is how my Code::Blocks and the project folder are set up: http://imgur.com/a/laDFM

I'm on Win 7 and using the SFML-2.0-windows-gcc-4.7-tdm-64bits release.

Edit: speaking of different release versions, I have both "libgcc_s_sjlj-1.dll" and "libgcc_s_dw2-1.dll" in my MingW which came with Code::Blocks.


5
General / I still can't create a window after reading the tutorial
« on: April 23, 2013, 01:06:59 pm »
I followed the tutorial on "getting started" and "opening a window". I used the source code directly from the "opening a window" tutorial and it compiles without error in CodeBlocks. When I run the executable I don't get a window though. I've tried creating both a "console application" and "SFML project" in CodeBlocks but the result is always the same. What am I doing wrong?

Pages: [1]