alexandrainst / processing_websockets

A web socket library, including both server and client, for Processing
MIT License
91 stars 36 forks source link

Either remove or implement features #30

Open dattasaurabh82 opened 4 months ago

dattasaurabh82 commented 4 months ago

Platform:

OS: macOS ventura 13.4 processing ver Processing version: 4.0.b8 and 3.5.4

Context:

The below functions, for CLIENT, doesn't work, as in they do not output anything.

webSocketConnectEvent(String uid, String ip);
webSocketDisconnectEvent(String uid, String ip);

Details

I maybe wrong, but I was hoping that the client connection handler events have been implemented. As they have been mentioned in the javadocs as well as in the README. But for me, they do not work for me.

Even for a simple example as below:

import websockets.*;

WebsocketClient wsc;

void setup() {
    size(200, 200);

    newEllipse=true;

    wsc= new WebsocketClient(this, "ws://localhost:8765/test");
}

void draw() {
}

void webSocketEvent(String msg) {
    println(msg);
}

public void webSocketConnectEvent(String uid, String ip) {
    println("Someone connected", uid, ip);
}

public void webSocketDisconnectEvent(String uid, String ip) {
    println("Someone disconnected", uid, ip);
}

The .java files exist in the src dir but probably have not been compiled. I also saw a note in javadoc, that some things were not implemented.

|Trolling on the forum I saw that downloading this zip apparently solves it (and in my mind I went probably there things were at-least implemented): https://github.com/alexandrainst/processing_websockets/blob/master/webSockets.zip

To my surprise it still doesn't work.