Public Types | Public Member Functions

gnash::NetConnection_as Class Reference

NetConnection ActionScript class. More...

#include <NetConnection_as.h>

Inheritance diagram for gnash::NetConnection_as:
Inheritance graph
Collaboration diagram for gnash::NetConnection_as:
Collaboration graph

List of all members.

Public Types

enum  StatusCode {

Public Member Functions

 NetConnection_as (as_object *owner)
 ~NetConnection_as ()
virtual void update ()
 Process connection stuff.
std::string validateURL () const
 Make the stored URI into a valid and checked URL.
void call (as_object *asCallback, const std::string &methodName, const std::vector< as_value > &args, size_t firstArg)
void close ()
 Process the close() method.
void connect (const std::string &uri)
 Process the connect(uri) method.
void connect ()
 Carry out the connect(null) method.
bool isConnected () const
void setURI (const std::string &uri)
const std::string & getURI () const
void notifyStatus (StatusCode code)
 Notify the NetConnection onStatus handler of a change.
std::auto_ptr< IOChannelgetStream (const std::string &name)
 Get an stream by name.
void markReachableResources () const
 Mark responders associated with remoting calls.

Detailed Description

NetConnection ActionScript class.

Provides interfaces to load data from an URL

Member Enumeration Documentation


Constructor & Destructor Documentation

gnash::NetConnection_as::NetConnection_as ( as_object owner  ) 
gnash::NetConnection_as::~NetConnection_as (  ) 

Member Function Documentation

void gnash::NetConnection_as::call ( as_object asCallback,
const std::string &  methodName,
const std::vector< as_value > &  args,
size_t  firstArg 
void gnash::NetConnection_as::close ( void   ) 

Process the close() method.

FIXME: This should close an active connection as well as setting the appropriate properties.

Queue the current call queue if it has pending calls

TODO: what should actually happen here? Should an attached NetStream object be interrupted?

References CONNECT_CLOSED, and notifyStatus().

Referenced by connect().

void gnash::NetConnection_as::connect ( const std::string &  uri  ) 
void gnash::NetConnection_as::connect (  ) 

Carry out the connect(null) method.

Called on NetConnection.connect(null).

The status notification happens immediately, isConnected becomes true.

References close(), CONNECT_SUCCESS, and notifyStatus().

std::auto_ptr< IOChannel > gnash::NetConnection_as::getStream ( const std::string &  name  ) 
const std::string& gnash::NetConnection_as::getURI (  )  const [inline]
bool gnash::NetConnection_as::isConnected (  )  const [inline]
void gnash::NetConnection_as::markReachableResources (  )  const [virtual]

Mark responders associated with remoting calls.

Reimplemented from gnash::ActiveRelay.

References gnash::for_each(), gnash::ActiveRelay::owner(), and gnash::GcResource::setReachable().

void gnash::NetConnection_as::notifyStatus ( StatusCode  code  ) 

Notify the NetConnection onStatus handler of a change.

This is a new normal object each time (see

References gnash::Global_as::createObject(), gnash::getGlobal(), gnash::as_object::init_member(), gnash::key::o, gnash::ActiveRelay::owner(), and gnash::NSV::PROP_ON_STATUS.

Referenced by close(), and connect().

void gnash::NetConnection_as::setURI ( const std::string &  uri  ) 
void gnash::NetConnection_as::update (  )  [virtual]

Process connection stuff.

Implements gnash::ActiveRelay.

std::string gnash::NetConnection_as::validateURL (  )  const

Make the stored URI into a valid and checked URL.

FIXME: this should not use _uri, but rather take a URL argument. Validation should probably be done on connect() only and return a bool indicating validity. That can be used to return a failure for invalid or blocked URLs.

References _, gnash::URLAccessManager::allow(), gnash::getRunResources(), gnash::ActiveRelay::owner(), and gnash::URL::str().

The documentation for this class was generated from the following files: