COMMUNITY

Socket communication from client to server


#1

I want to set up a very basic line of communication between a client and server for what will eventually be part of an android/iphone app.

I’ve followed the old tutorial at http://old.haxe.org/doc/neko/client_server

I can see how I can get the client to run commands by sending text string from the server to the client, and having the client run a function when it detects the appropriate string (same as the ‘exit’ code in the example).

What I’m struggling to do is to do the opposite; for the client to send the server similar text codes, and the server to be ale to interpret them. I’ve tried using the input.readline() command on the server, but this just causes an error.

Any help greatly appreciated!


(Jens Fischer) #2

Might help to know what error exactly. :wink:


#3

That’s a fair point! I get this same error in the client and server when I add a readline to the server.

error


(Kaloyan Dimitrov) #4

In haxe the readline function is with capital letter i.e. readLine. This might help.