Re: minisphere 1.4.2
Reply #700 –
Thanks a TON! It is unbelievable how fast you update and commit.
Good code too, will re-test stuff later-on.
I'm trying to get the networking working, but I seem to either not "getting" it, or there is a bug:
var LocalPort = 9500;
var Listen = 255; // MAXCONNECT
var server = new ListeningSocket(LocalPort, Listen);
if(! server ){Abort("Could not open socket on " + LocalPort)}
var socket = server.accept();
if(socket === NULL){Abort("Could not accept socket")}
if(socket.isConnected()){
var len = socket.getPendingReadSize();
if(0 < len && len < 1024){
var BUFFER = socket.readString(len);
socket.write("404 Not Found\n\r\n\r");
Abort(BUFFER);
}else{
Abort("len is not ok " + len);
}
socket.close();
}
But for
var socket = server.accept();
it throws:
JS Error: main.js:10 - TypeError: not callable
I wrapped it in a try loop, of course, but even then, a webbrowser connects, but then "hangs" (as opposed to an immediate "unable to connect" error). So we know it is connecting, but it seems it is not able to start up communications.