Hi Alexandar,

as it was me, who advised - emscripent_wget - if you try to search code is
done around async xmlhttprequest , it works just fine if it is used in
async way.

if you want how to make things, there is an engine
https://github.com/floooh/oryol which implements IQ queues such that after
you got response it is stored and on next tick you can get if from IO
queue

it is possible to make things sync, but that requires deeper knowledge of
internals so most probably you will fail with that.

thus my suggestion - to keep things async as if you used pure
xmlhttprequest

Regards
Sergey



On Fri, Nov 14, 2014 at 10:43 PM, Aleksandar Stančić <[email protected]>
wrote:

> I tried wget2_data now and it still doesn't work. It seems it isn't even
> trying to download the file, it's not HTTP related, as with v2 I
> immediately get onerror callback and error code is 0, and my error message
> is NULL, so I still have no clue what is going on. I am relatively new to
> Emscripten, so I might be missing something. Do I need some special
> settings for compiler and/or linker to make this work? Anything
> browser-related? I tested on latest Firefox and Chrome on Linux, same thing
> every time.
>
> On Thursday, November 13, 2014 11:36:36 AM UTC+1, Sergey Kurdakov wrote:
>>
>> Hi Alexandar,
>>
>> >won't emscripten_async_wget serve your needs?
>>
>> I mean set of functions
>>
>> emscripten_async_wget
>> emscripten_async_wget2
>> emscripten_async_wget_data
>> emscripten_async_wget2_data
>>
>> Regards
>> Sergey
>>
>>
>> On Thu, Nov 13, 2014 at 1:24 PM, Sergey Kurdakov <[email protected]>
>> wrote:
>>
>>> Hi Alexandar.
>>>
>>> won't emscripten_async_wget serve your needs? it sends requests to
>>> server and params can adjast which type of request is sent.
>>>
>>> Regards
>>> Sergey
>>>
>>> On Thu, Nov 13, 2014 at 11:58 AM, Aleksandar Stančić <[email protected]>
>>> wrote:
>>>
>>>> Hi! I'm writing a game in C++/OGL (to be published on the web through
>>>> Emscripten) that needs some interaction with a server, written in
>>>> PHP/MySQL. I already prepared the database and PHP code, and now, the
>>>> surprisingly difficult part is connecting the two. Is there a simple way of
>>>> loading a web page with a few POST strings in C++/Emscripten? Two-to-three
>>>> strings go in (POST) and I need to read one string or integer on the output
>>>> (HTTP response). emscripten_wget just hangs on me, and mixing JS + C++
>>>> seems to be able to transfer only numbers (ASM). Can someone point me in
>>>> the right direction? I feel like I'm missing something obvious, and I
>>>> wouldn't really know, since I'm not much of a web developer. Thanks.
>>>>
>>>> Just to clarify, I have a PHP page like this:
>>>>
>>>> $a = $_POST['a']  // a and b need to come from C++
>>>> $b = $_POST['b']
>>>>
>>>>
>>>>
>>>> // do stuff with $a & $b
>>>>
>>>>
>>>> echo($c)  // a string, under 100 regular ASCII chars, nothing special
>>>>
>>>> So, I need to do a HTTP POST request (I can switch to GET if that'll
>>>> make things easier), and read a single line of text back into C++.  What
>>>> would be a good way of doing that? I hate to be *that guy**,* but it
>>>> is kind urgent (I really wrote myself into a corner with this one, I
>>>> expected this to be easy), so any tips are greatly appreciated.
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "emscripten-discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to