Hi,
sorry for the delay I was busy and not really checking the group
by default redtamarin does not have the classic flash.net.Socket classes
(it is possible to emulate them but not done yet)
so you would want to use avmplus.Socket class
documented here
here an example implementing a socket policy server
in short, the Socket class impl. in redtamarin allow to do more stuff
but is a bit harder to use
the implementation is very close to the classic BSD socket in C/C++
now for the flow, here the 2 best way imho
1) implement the missing libraries from the Flash Platform
see avmglue
for example
----
{
public class Socket extends EventDispatcher implements IDataInput, IDataOutput
{
private var _sock:avmplus.Socket; //use the full package path
public function Socket( host:String = null, port:int = 0 )
{
_sock = new avmplus.Socket();
}
public function connect(host:String, port:int):void
{
_sock.connect( host, port );
}
}
}
----
you would have to do your own wiring for the events
for ex
----
{
public class Socket extends EventDispatcher implements IDataInput, IDataOutput
{
private var _sock:avmplus.Socket; //use the full package path
public function Socket( host:String = null, port:int = 0 )
{
_sock = new avmplus.Socket();
_hookCallbacks();
}
private function _onConnect():void
{
dispatchEvent( new Event( Event.CONNECT ) );
}
private function _hookCallbacks():void
{
_sock.onConnect = _onConnect;
}
public function connect(host:String, port:int):void
{
_sock.connect( host, port );
}
}
}
----
or
2) use conditional compilation
see
this allow you to keep the different implementations in the same file
and can be more desirable in some cases
cheers,
zwetan