Skip to content

Instantly share code, notes, and snippets.

@aonic
Created December 5, 2010 04:35
Show Gist options
  • Select an option

  • Save aonic/728800 to your computer and use it in GitHub Desktop.

Select an option

Save aonic/728800 to your computer and use it in GitHub Desktop.
<embed width="0" height="0" allowscriptaccess="always" name="flashSock" id="flashSock"
src="./swf/jsCom.swf" type="application/x-shockwave-flash"></embed>
<script type="text/javascript">
var onData = function(data) {
alert('Server said:' + data);
}
var onClose = function() {
alert('Goodbye.');
}
// initialize connection with server running on localhost port 3002 (included)
var fs = new AONIC.api.PushCommunication('localhost', '3002', 'flashSock');
fs.addCallback('onData', onData).addCallback('onClose', onClose);
fs.send('John Doe.'); // -> alert('Server said: Welcome John Doe!');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment