Skip to content

bendoran/amp-as3

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
 
 
 
 

#AMP AS3

AMP AS3 is a pure ActionScript 3 implementation of AMP (Asynchronous Messaging Protocol) a lightweight typed messaging protocol for asynchronouse 2 way communication between server and client.

More info on AMP can be found at:

http://amp-protocol.net/

##Simple Example

Create a command

class Hello extends AmpCommand{
	public function Hello(){
		this.args = { message : AMP_STRING };
		this.response = { success : AMP_BOOLEAN };
	}
}

Create the AMP server and add a connected handler, for the socket.

amp = new AMP( "127.0.0.1", 6000 );
amp.addEventListener( AMPEvent.AMP_CONNECTED, ampConnectedHandler );
amp.connect();

Call the remote server with the Command

amp.callRemote( Hello, { message : "Hello World" } );

Respond to the remote server calling the command

amp.setResponder( Hello, helloHandler );		

function helloHandler( object : Object ){
	trace("Message Recieved:", object.message );
}		

##Future Changes

  • Strict object typing and AMP compliant error messaging
  • Implement AMP 'Box Object'
  • Pure AS3 server implementation (create server open socket etc)

About

AS3 Implementation of AMP (Asynchronous Messaging Protocol) first utilised in the Python Twisted library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published