ok it works fine now, Thanks to all....
I have a last problem of policy file request between a server and a client:
Here the code of the Client Socket:
class Socket{ public var socketClient :flash.net.Socket; var texteEvent :
TextEvent; public function new () {
flash.system.Security.loadPolicyFile("http://192.168.0.2:50/crossdomain.xml");
socketClient = new flash.net.Socket();
socketClient.addEventListener(Event.CLOSE, closeHandler);
socketClient.addEventListener(Event.CONNECT, connectHandler);
socketClient.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
socketClient.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
socketClient.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);
socketClient.connect("192.168.0.2",5000); } function readResponse() {
var str:String = socketClient.readUTFBytes(socketClient.bytesAvailable);
texteEvent=new TextEvent(TextEvent.TEXT_INPUT,str);
socketClient.dispatchEvent(texteEvent); }
function closeHandler(event:Event) { //trace("closeHandler: " + event);
}
function connectHandler(event:Event) { trace("Connected");
sendRequest("aaa"); }
function ioErrorHandler(event:IOErrorEvent) { //
trace("ioErrorHandler: " + event); }
function securityErrorHandler(event:SecurityErrorEvent) {
//trace("securityErrorHandler: " + event); }
function socketDataHandler(event:ProgressEvent) { readResponse();
} public function sendRequest(string:String) { if(socketClient.connected)
{ socketClient.writeUTFBytes(string); socketClient.flush(); } }}
And Here the code of the server :
class SocketServeur extends neko.net.ServerLoop<neko.net.Socket>{ var
socketClients: List<neko.net.Socket>; public function new () {
super(newClient); this.processClientData = ProcessClientData;
this.socketClients=new List(); trace("Starting server...");
this.listenCount=2; this.run(new neko.net.Host("192.168.0.2"),5000); }
function newClient(clientSocket:neko.net.Socket):Dynamic { trace("Client
connected... "+ clientSocket.peer().host.toString()); return clientSocket; }
function ProcessClientData(d : neko.net.Socket, buf : String, bufpos : Int,
buflen : Int) : Dynamic { var data:String = buf.substr(0,buflen);
trace(d.peer().host.toString()+"$"+data);
for( client in this.clients ) {
if(client.peer().host.toString()+client.peer().port!=d.peer().host.toString()+d.peer().port)
{ client.write(data); trace("Sending"); } }
return data.length; } }
I get all the time policy-file-request on server and i dont understand why
because i have put the crossdomain.xml to the trunk. Loadpolicyfile and put a
server on port 843 doesnt work too...
I ve tried http://haxe.org/doc/flash/chat and i got the same problem....
It doesn't work on my Gentoo distribution with Apache 2.2 and it doesn't work
with nekotools on port 50.
Has anyone some ideas ?> Date: Sun, 20 Jul 2008 19:57:04 +0400> From: [EMAIL
PROTECTED]> To: [email protected]> Subject: Re: [Neko] Installing
libgc1> > Hello Mike,> > MM> ok it works perfectly thank you very much.> MM> >
MM> But i have now another problem. i have written a neko program on> MM>
FlashDevelopp on Windows and i cant compile it on Linux ... i have> MM> the
following error "Unexpected main" on Linux and not on Windows.> MM> Why?> >
Maybe you can post a small example here and also how exactly you're> trying to
compile? Then we can probably help ;)> > Mike> > >> Date: Fri, 18 Jul 2008
21:16:57 +0200> >> From: [EMAIL PROTECTED]> >> To: [email protected]>
>> Subject: Re: [Neko] Installing libgc1> >> > >> On Fri, Jul 18, 2008 at 6:04
PM, Mike M <[EMAIL PROTECTED]> wrote:> >> > It is said on nekovm site that its
neccessary to install libgc1 package on> >> > the system; but i cant find this
one..> >> > Could Someone Help me please ?> >> > >> At
http://nekovm.org/download there's a link to it:> >>
http://www.hpl.hp.com/personal/Hans_Boehm/gc/> >> > >> -- > >> Kacper.> >> > >>
-- > >> Neko : One VM to run them all> >> (http://nekovm.org)> > > MM> Avec une
webcam et Messenger partagez vos émotions en vidéo ! Téléchargez gratuitement
!> > > -- > Best regards,> Michael mailto:[EMAIL PROTECTED]
_________________________________________________________________
Retouchez, classez et partagez vos photos gratuitement avec le logiciel Galerie
de Photos !
http://www.windowslive.fr/galerie/--
Neko : One VM to run them all
(http://nekovm.org)