All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.datafx.websocket.DataFXEndpoint Maven / Gradle / Ivy

There is a newer version: 8.0b5
Show newest version
package org.datafx.websocket;

import javax.websocket.Endpoint;
import javax.websocket.EndpointConfig;
import javax.websocket.MessageHandler;
import javax.websocket.Session;

/**
 *
 * @author johan
 */
public class DataFXEndpoint extends Endpoint implements MessageHandler.Whole {

    static protected WebSocketReader parent;
    
    @Override
    public void onOpen(Session session, EndpointConfig config) {
        System.out.println("Endpoint is open now");
        session.addMessageHandler(this);
    }

    @Override
    public void onMessage(String message) {
        System.out.println("DataFXEndpoint got a message!!");
        parent.addAvailableData(message);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy