Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
air.net 
SecureSocketMonitor 
Packageair.net
Classpublic class SecureSocketMonitor
InheritanceSecureSocketMonitor Inheritance SocketMonitor Inheritance ServiceMonitor Inheritance EventDispatcher Inheritance Object

Runtime Versions: AIR 2.0

A SecureSocketMonitor object monitors availablity of a TCP endpoint over Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols.

This class is included in the aircore.swc file. Flash Builder loads this class automatically when you create a project for AIR. The Flex SDK also includes this aircore.swc file, which you should include when compiling the application if you are using Flex SDK.

In Adobe® Flash® CS3 Professional, this class is included in the ServiceMonitorShim.swc file. To use classes in the air.net package , you must first drag the ServiceMonitorShim component from the Components panel to the Library and then add the following import statement to your ActionScript 3.0 code:

import air.net.*;

To use air.net package in Adobe® Flash® Professional (CS4 or higher):

  1. Select the File > Publish Settings command.
  2. In the Flash panel, click the Settings button for ActionScript 3.0. Select Library Path.
  3. Click the Browse to SWC File button. Browse to Adobe Flash CSn/AIKn.n/frameworks/libs/air/aircore.swc file in the Adobe Flash Professional installation folder.
  4. Click the OK button.
  5. Add the following import statement to your ActionScript 3.0 code: import air.net.*;



Public Properties
 PropertyDefined By
 InheritedAIR-only available : Boolean
Whether the service is currently considered "available." The initial value is false until either a status check sets the property to true or the property is initialized to true explicitly. Typically, this property is set by the checkStatus() implementation in a subclass or specializer, but if the application has independent information about a service's availability (for example, a request just succeeded or failed), the property can be set explicitly.
ServiceMonitor
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedAIR-only host : String
[read-only] The host being monitored.
SocketMonitor
 InheritedAIR-only lastStatusUpdate : Date
[read-only] The time of the last status update.
ServiceMonitor
 InheritedAIR-only pollInterval : Number
The interval, in milliseconds, for polling the server.
ServiceMonitor
 InheritedAIR-only port : int
[read-only] The port being monitored.
SocketMonitor
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 InheritedAIR-only running : Boolean
[read-only] Whether the monitor has been started.
ServiceMonitor
Public Methods
 MethodDefined By
  
Creates a SecureSocketMonitor object for a specified TCP endpoint.
SecureSocketMonitor
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
AIR-only makeJavascriptSubclass(constructorFunction:Object):void
[static] Adds public ServiceMonitor methods to a JavaScript constructor function's prototype.
ServiceMonitor
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Starts the service monitor.
ServiceMonitor
 Inherited
Stops monitoring the service.
ServiceMonitor
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
  
[override] Returns the string representation of the specified object.
SecureSocketMonitor
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Protected Methods
 MethodDefined By
 Inherited
[override] Calling the checkStatus() method of a SocketMonitor object causes the application to try connecting to the socket, to check for a connect event.
SocketMonitor
  
[override] Creates a SecureSocket object.
SecureSocketMonitor
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
 InheritedIndicates that the service status has changed.ServiceMonitor
Constructor Detail
AIR-only 

SecureSocketMonitor

()Constructor
public function SecureSocketMonitor(host:String, port:int)

Runtime Versions: AIR 2.0

Creates a SecureSocketMonitor object for a specified TCP endpoint.

After creating a SecureSocketMonitor object, the caller should call start to begin monitoring the status of the service.

As with the Timer object, the caller should maintain a reference to the SecureSocketMonitor object. Otherwise, the runtime deletes the object and monitoring ends.

Parameters
host:String — The host to monitor.
 
port:int — The port to monitor.
Method Detail

AIR-only createSocket

()method
override protected function createSocket():Socket

Runtime Versions: AIR 2.0

Creates a SecureSocket object.

Returns
Socket — SecureSocket the SecureSocket object to be used by this SocketMonitor or null if secure sockets are not supported on the current system.

AIR-only toString

()method 
override public function toString():String

Runtime Versions: AIR 2.0

Returns the string representation of the specified object.

Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, a subclass of Object implements function toString():String instead of using an override of the base class.

Returns
String — A string representation of the object.