-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ram nodebox/sockets 4 #429
base: master
Are you sure you want to change the base?
Conversation
Added webSocket classes and plugged them into Network Functions
Command structure in plcae to control app
… automatically deal with disconections etc
@@ -1,8 +1,18 @@ | |||
package nodebox.function; | |||
|
|||
import com.sun.org.apache.xerces.internal.impl.dv.xs.BooleanDV; | |||
import com.sun.org.apache.xpath.internal.operations.Bool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two imports use proprietary, internal code. I don't think you use them inside of the code. Remove?
*/ | ||
|
||
@ClientEndpoint | ||
public class webSocketClientEndpoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classes should start with a capital letter (e.g. WebSocketClientEndpoint
)
public Session call() throws Exception { | ||
try { | ||
WebSocketContainer container = ContainerProvider.getWebSocketContainer(); | ||
return(container.connectToServer(annotatedEndpointInstance, uri)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line causes the code to fail compiling. This is the error I get:
webSocketClientEndpoint.java:45: error: local variable annotatedEndpointInstance is accessed from within inner class; needs to be declared final
[javac] return(container.connectToServer(annotatedEndpointInstance, uri));
Thanks for the PR. However, I couldn't get it to compile -- see the inline notes for more details (this is on Linux with OpenJDK 8). |
Hi! This is my first pull request and I'm a git noob so bear with me. It's also my first Java project.
Main change is for various upgrades the project is now on Java 8
Most of the changes are in:
nodebox/src/main/java/nodebox/network/
This is where all the WebSocket code is. WebSocketMessaging.java is for static access from graph nodes. Each open document has an instance of webSocketClientEndpoint.java for commands etc.
I've added some docs here:
nodebox/src/main/java/nodebox/network/README.md
And all the messaging strings are defined here:
nodebox/src/main/java/nodebox/network/WSDefs.java
Added the new nodes and JSON functions here:
nodebox/src/main/java/nodebox/function/NetworkFunctions.java
Various threading fixes, added logic to enable sockets
nodebox/src/main/java/nodebox/client/NodeBoxDocument.java
Added logic to enable sockets
nodebox/src/main/java/nodebox/client/Application.java