{"id":13744573,"url":"https://github.com/Richard-Walton/TwoWayLocalConnection","last_synced_at":"2025-05-09T03:32:25.706Z","repository":{"id":144903091,"uuid":"3995953","full_name":"Richard-Walton/TwoWayLocalConnection","owner":"Richard-Walton","description":"Two way, asynchronous, LocalConnection class which is not subject to the 40KB message size limit imposed by the standard actionscript LocalConnection class","archived":false,"fork":false,"pushed_at":"2016-07-12T23:45:31.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-11-15T16:40:56.107Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Richard-Walton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-04-11T17:08:40.000Z","updated_at":"2016-07-12T23:45:32.000Z","dependencies_parsed_at":"2024-01-14T23:59:53.559Z","dependency_job_id":null,"html_url":"https://github.com/Richard-Walton/TwoWayLocalConnection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard-Walton%2FTwoWayLocalConnection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard-Walton%2FTwoWayLocalConnection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard-Walton%2FTwoWayLocalConnection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard-Walton%2FTwoWayLocalConnection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Richard-Walton","download_url":"https://codeload.github.com/Richard-Walton/TwoWayLocalConnection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253183212,"owners_count":21867381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:01:12.058Z","updated_at":"2025-05-09T03:32:25.480Z","avatar_url":"https://github.com/Richard-Walton.png","language":"ActionScript","readme":"﻿This project extends the actionscript LocalConnection class to add the ability to make to make asynchronous function calls between two connected clients.  Additionally, messages sent between two connected clients are not subject to the 40KB limit imposed by the standard LocalConnection class:\n\nExample:\n```\npackage\n{\n        import com.dubitplatform.localConnection.LocalConnectionService;\n\t\n\timport flash.events.StatusEvent;\n\t\n\timport mx.events.PropertyChangeEvent;\n\timport mx.rpc.AsyncToken;\n\n\tpublic class LocalConnectionTest\n\t{\n\t\tprivate var localConnectionSerivce:LocalConnectionService;\n\t\t\n\t\tpublic function LocalConnectionTest()\n\t\t{\n\t\t\t/* Instanciate new LocalConnectionService and provide the 'client' object which contains functions which \n  \t\t       are available to be called by a remote client */\n\t\t\tlocalConnectionSerivce = new LocalConnectionService(this);\n\t\t\t\n\t\t\t/* Listen for status events from the service - Specifically the \"Connected\" event.  Possible status events \n\t\t\t   dispatched are:\n\t\t\t\t\"idle\" - Nothing is happening\n\t\t\t\t\"connecting\" - The service is trying to establish a connection\n\t\t\t\t\"waitingForRemoteClient\" - The service is waiting for a remote client to connect\n\t\t\t\t\"connected\" - A remote client has connected\n\t\t\t\t\"timedOut\" - The remote client has timed out\n\t\t\t\t\"closing\" - The service is disconnecting\n\t\t\t*/\n\t\t\tlocalConnectionSerivce.addEventListener(StatusEvent.STATUS, function(e:StatusEvent) : void\n\t\t\t{\n\t\t\t\tif(e.code == LocalConnectionService.CONNECTED) callRemoteFunction();\n\t\t\t});\n\t\t\t\n\t\t\t// Start the service\n\t\t\tlocalConnectionSerivce.connect(\"localConnectionTest\");\n\t\t}\n\t\t\n\t\tprivate function callRemoteFunction() : void\n\t\t{\n\t\t\t/* When calling a function on the remoteClient an asyncToken is returned.  When the clients reponse is recieved\n\t\t\t   this token will be notified - Here we are calling the \"timesByTwo\" function on the remote client */\n\t\t\tvar asyncToken:AsyncToken = localConnectionSerivce.remoteClient.timesByTwo(42);\n\t\t\t\n\t\t\t// Add listener which will be notified when a response has been recieved\n\t\t\tasyncToken.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, function(e:PropertyChangeEvent) : void\n\t\t\t{\n\t\t\t\ttrace(e.newValue); // Traces out 84\n\t\t\t});\n\t\t}\n\t\t\n\t\t// This public function is available to a remote client\n\t\tpublic function timesByTwo(input:int) : int\n\t\t{\n\t\t\treturn input * 2;\n\t\t}\n\t}\n}\n```\n","funding_links":[],"categories":["Utilities"],"sub_categories":["Asynchronous"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRichard-Walton%2FTwoWayLocalConnection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRichard-Walton%2FTwoWayLocalConnection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRichard-Walton%2FTwoWayLocalConnection/lists"}