Connecting to a Server

Hi, I want to learn about the Client class for processing because I want to build a console to communicate with other people, the problem is that I do not have a server that I can use. Online I found that you can technically use your PC as a server but I couldn’t understand how (I use macOS 11.1) and most importantly I couldn’t understand how to use the Client class if the server is the PC that the program is running on. DOes anyone know how to move from here?
Thanks :slight_smile:

Hello @Leoperix03, sorry no-one has replied. I’m no expert on this but I’ve just done a simple test.

  • File, Examples, Libraries, Networks, Chatserver - just run that.
  • Client example. Copy the code from there, change the port 5204 to 10002 as in the server and run it. See that it runs alright, but if the server isn’t running first, it crashes. This is all on 1 PC.
  • in the client program add this line as the last line of draw(). myClient.write(“Hello World.”); - run that and text appears on the server window.

Hope that gets you started.

1 Like

thank you very much for the answer, I will try that and I will let you know.
Thanks again