Forum Replies Created
-
AuthorPosts
-
Anyone else wanting to give this a go? heh
Thanks abakobo!
I’ve installed all of those, and some others…
Still having issues though.I’ll do another compile (takes forever) with different settings, see if it helps, then report back here.
Oh, I had no idea you had to download ‘extra’ things.
But I’m still getting errors, perhaps more stuff to install? *sigh*
I’ll investigate.Shr Shl?
Monkey 2 can probably do what some of those functions do.
So it’ll be a sort of a waste doing a raw translate, but I guess it’s better than nothing!I won’t be home for a while, so I can’t do it right now.
But :+ means +=Here’s some Monkey X source code: http://wasted.nz/posts.php?topic=203483#6
sdl2.SDL_HideWindow( Self.SDLWindow ) and sdl2.SDL_ShowWindow( Self.SDLWindow ) seems to do the trick.
Things get a bit weird at places, and you may need to redraw the window when shown… but overall it works.Ah okay, I hadn’t even thought about it working on other targets…
I’ve been poking about, trying to figure it out myself, atleast on desktop targets since that’s all I need.
But I’m not quite getting the results I want.Here’s a simple example if anyone’s interested:
Monkey12345678910111213141516171819202122232425262728293031323334353637#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class BigWindow Extends WindowMethod New()Super.New("Big Window", 640, 480)EndEndClass SmallWindow Extends WindowMethod New()Super.New("Small Window (Close Me)", 320, 240, WindowFlags.Hidden)Local appearTimer:Timer=New Timer(1, Lambda()Self.Visible=TrueEnd)EndMethod OnWindowEvent( event:WindowEvent ) OverrideSelect event.TypeCase EventType.WindowCloseSelf.Visible=FalseEndEndEndFunction Main()New AppInstanceNew BigWindowNew SmallWindowApp.Run()EndWait for the small window to appear, then try to close it (which should just hide it)
Hidden windows do work if they’re created with ‘WindowFlags.Hidden’, but showing them and then hiding them manually causes the error “Windows cannot be deactivated”Oh, this is an old thread heh.
I don’t think it’s the right time to charge for Monkey 2.
Charging for something increases the expectations, substantially.
And I don’t think Monkey 2 is ready to compete with other languages yet.
It’s heading for greatness, but it’s not quite there yet.
It needs to grow, and some much needed polish and documentation.
He’d probably need to fresh up the webpage before all of it too, first impression are very important, especially when asking for money.If a free product can’t attract users yet, I don’t think the next step is to start charging for it.
It’s a shame you can’t use ‘New’ with extensions.
I’d love to haveMonkey12345678910Struct Color ExtensionMethod New( r:UByte,g:UByte,b:UByte,a:UByte=255 )Self.r=r/255.0Self.g=g/255.0Self.b=b/255.0Self.a=a/255.0EndEndOh well, you can still do:
Monkey1234567Struct Color ExtensionFunction FromByte:Color( r:UByte,g:UByte,b:UByte,a:UByte=255 )Return New Color( r/255.0,g/255.0,b/255.0,a/255.0 )EndEndHere’s my horribly bad and very quickly thrown together WebSocket module (server and client) for BlitzMax:
https://bitbucket.org/Hezkore/blitzmax-websocketIt builds upon FWeinb’s older WebSocket module and uses Vertex.BNetEx and Brucey’s Base64, but they’re included.
The “sample” folder has a working server example, combined with the same HTML chat I shared from above.
Sadly, I don’t have BlitzMax installed, nor do I have the server compiled.The whole thing is a flipping mess, but “websocket.bmx” has some good stuff in it.
I guess you should be able to at least connect with http, but I doubt you’ll be able to do a full http GET
Exactly.
The handshake will be all wrong, but a connection should be made.Will have a closer look when I get some free time, although I don’t quite know that’ll be right now.
Alright, thanks Mark!
I’m much more interested in the “secret project” anyways, it’s something I’ve wanted to experiment, so it’ll keep me busy while Emscripten Sockets don’t work heh.Sorry if I’m frustrating you Mark heh.
Thanks for all the help! <3But that doesn’t even connect to websocket server so I’m not surprised it doesn’t work! Is it supposed to?
I believe it should still connect, yes.
But either way, you posted an echo WebSocket test client link before which connects to “ws://demos.kaazing.com/echo”
So you could give the M2 example code a go using that echo server.
(Doesn’t work -1 error)Can you show an example of a js or other app successfully connecting to this (or any!) websocket server?
Once again, the link you posted is a client that can successfully connect to “ws://demos.kaazing.com/echo”
But here’s an old chat app I’ve made to connect to the same demo echo server, and it works.
Save as .htmlXHTML123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051<title>WebSocket Chat Test</title><meta charset=UTF-8 /><script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script><br /><form name="chat" /><textarea cols="100" rows="20" id="chat"></textarea><br /><input type="text" id="text" /><input type="submit" value="Send"></form><script>$(function(){var UserName = prompt("Username:", "");var ws// Let us open a web socketif(window.WebSocket){ws=new WebSocket("ws://demos.kaazing.com/echo");}else{ws=new MozWebSocket("ws://demos.kaazing.com/echo");}ws.onopen = function(){// Web Socket is connected, send data using send()ws.send("name"+String.fromCharCode(0)+UserName); // Say Hello...};ws.onmessage = function (evt){var $chat = $("#chat");var txt = $chat.val();$chat.val(txt+evt.data+"\n");};ws.onclose = function(){var $chat = $("#chat");var txt = $chat.val();$chat.val(txt+"Close\n");};$('form').submit(function(e){var text = $('#text').val();$('#text').val('');var $chat = $('#chat');ws.send(text);$chat.val($chat.val()+UserName+": "+text+"\n");e.preventDefault();});});</script>Can you then show an example of an monkey2 app unsuccessfully attempting to do the same thing?
http://monkeycoder.co.nz/forums/topic/simple-http-1-1-web-page-download/
Change address to the “ws://demos.kaazing.com/echo” echo test server.Well as I said in my first post, DruggedBunny made an example which shows the error in Emscripten.
Copy the example code from above: http://monkeycoder.co.nz/forums/topic/simple-http-1-1-web-page-download/
Compile using Emscripten.
The line
Monkey1If socketnever returns True, and “-1” is printed to the console for some reason.
Doesn’t matter what server you try to connect to, WebSocket server or not, same result every time.
So even if I were to respond to the WebSocket standards, there’s no way to actually connect to any form of server.
Monkey 2 literally just prints “-1” whenever you try to connect to a server when compiled to Emscripten.The problem is that as soon as I connect to my WebSocket server, that’s worked with a lot of other WebSocket apps, M2 just spits out -1.
So even if I do follow the standards for WebSocket, I wouldn’t be able to actually connect to any of the servers.
Or is this just me having that problem?
Hehe alright, I’ll investigate a bit!
-
AuthorPosts