Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active November 14, 2018 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/0dc7dbbf901e03c9b1a08754875e4dc0 to your computer and use it in GitHub Desktop.
Save kenwebb/0dc7dbbf901e03c9b1a08754875e4dc0 to your computer and use it in GitHub Desktop.
Web Sockets
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Wed Nov 14 2018 11:57:06 GMT-0500 (Eastern Standard Time)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Web Sockets
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 0dc7dbbf901e03c9b1a08754875e4dc0
Keywords:
My Notes
--------
November 14, 2018
References
----------
(1) https://en.wikipedia.org/wiki/WebSocket
(2) https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
(3) https://www.tutorialspoint.com/websockets/websockets_overview.htm
(4) https://github.com/websockets/ws
Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js
(5) https://tools.ietf.org/html/rfc6455
(6) https://www.html5rocks.com/en/tutorials/websockets/basics/
(7) https://www.websocket.org/
(8) http://www.websocket.org/aboutwebsocket.html
(9) https://github.com/vjwang/WebSocketBook
(10) https://www.websocket.org/echo.html
very simple demo
(11) file:///home/ken/nodespace/websocket/websocket.html
(12) https://kaazing.com/inspecting-websocket-traffic-with-chrome-developer-tools/
very useful
(13) http://www.websocket.org/demos/racer/index.html
Control a WebGL Formula One car on your desktop from the Web browser of your smart phone by simply tilting it.
No browser extension or application installation needed.
Works over any network, such as WiFi, 4G, or LTE.
(14) https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol
(15) https://en.wikipedia.org/wiki/Java_Message_Service
(16) https://github.com/kaazing
(17) https://devcenter.heroku.com/articles/websockets
(18) https://devcenter.heroku.com/articles/node-websockets
(19) https://github.com/heroku-examples/node-ws-test
]]></Notes>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<Block/>
<Brick/>
<!-- quantities -->
<Height superClass="Quantity"/>
</_-.XholonClass>
<xholonClassDetails>
<Block>
<port name="height" connector="Height"/>
</Block>
</xholonClassDetails>
<PhysicalSystem>
<Block>
<Height>0.1 m</Height>
</Block>
<Brick multiplicity="2"/>
</PhysicalSystem>
<Blockbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var a = 123;
var b = 456;
var c = a * b;
if (console) {
console.log(c);
}
//# sourceURL=Blockbehavior.js
]]></Blockbehavior>
<Heightbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var myHeight, testing;
var beh = {
postConfigure: function() {
testing = Math.floor(Math.random() * 10);
myHeight = this.cnode.parent();
},
act: function() {
myHeight.println(this.toString());
},
toString: function() {
return "testing:" + testing;
}
}
//# sourceURL=Heightbehavior.js
]]></Heightbehavior>
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
$wnd.xh.Brickbehavior = function Brickbehavior() {}
$wnd.xh.Brickbehavior.prototype.postConfigure = function() {
this.brick = this.cnode.parent();
this.iam = " red brick";
};
$wnd.xh.Brickbehavior.prototype.act = function() {
this.brick.println("I am a" + this.iam);
};
//# sourceURL=Brickbehavior.js
]]></Brickbehavior>
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
console.log("I'm another brick behavior");
]]></Brickbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Block</title>
<rect id="PhysicalSystem/Block" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Height</title>
<rect id="PhysicalSystem/Block/Height" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
</g>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment