| Package | air.net | 
| Class | public class SocketMonitor | 
| Inheritance | SocketMonitor    ServiceMonitor   EventDispatcher   Object | 
| Runtime Versions: | AIR 1.0, AIR 1.0 | 
This class is included in the ServiceMonitor.swc file. Adobe ® Flash® Builder™ loads this class automatically when you create a project for AIR. The Flex® SDK also includes this servicemonitor.swc file, which you should include when compiling the application if you are using Flex SDK.
| Property | Defined By | ||
|---|---|---|---|
![]()  | 
     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 | |
![]()  | constructor : Object 
	 A reference to the class object or constructor function for a given object instance.  | Object | |
[read-only] 
	 The host being monitored.  | SocketMonitor | ||
![]()  | [read-only] 
     The time of the last status update.  | ServiceMonitor | |
![]()  | 
     The interval, in milliseconds, for polling the server.  | ServiceMonitor | |
[read-only] 
	 The port being monitored.  | SocketMonitor | ||
![]()  | prototype : Object [static] 
	 A reference to the prototype object of a class or function object.  | Object | |
![]()  | [read-only] 
     Whether the monitor has been started.  | ServiceMonitor | |
| Method | Defined By | ||
|---|---|---|---|
	 Creates a SocketMonitor object for a specified TCP endpoint.  | SocketMonitor | ||
![]()  | 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 | |
![]()  | 
	Dispatches an event into the event flow.  | EventDispatcher | |
![]()  | 
	Checks whether the EventDispatcher object has any listeners registered for a specific type 
	of event.  | EventDispatcher | |
![]()  | 
	 Indicates whether an object has a specified property defined.  | Object | |
![]()  | 
	 Indicates whether an instance of the Object class is in the prototype chain of the object specified 
	 as the parameter.  | Object | |
![]()  | [static] 
     Adds public ServiceMonitor methods to a JavaScript constructor function's prototype.  | ServiceMonitor | |
![]()  | 
	 Indicates whether the specified property exists and is enumerable.  | Object | |
![]()  | 
	Removes a listener from the EventDispatcher object.  | EventDispatcher | |
![]()  | 
     Sets the availability of a dynamic property for loop operations.  | Object | |
![]()  | 
     Starts the service monitor.  | ServiceMonitor | |
![]()  | 
     Stops monitoring the service.  | ServiceMonitor | |
![]()  | 
	 Returns the string representation of this object, formatted according to locale-specific conventions.  | Object | |
[override] 
	 
     
	 Returns the string representation of the specified object.  | SocketMonitor | ||
![]()  | 
	 Returns the primitive value of the specified object.  | Object | |
![]()  | 
	Checks whether an event listener is registered with this EventDispatcher object or any of 
	its ancestors for the specified event type.  | EventDispatcher | |
| Method | Defined By | ||
|---|---|---|---|
[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 | ||
| property | 
host:String  [read-only] | Runtime Versions: | AIR 1.0 | 
The host being monitored.
    public function get host():String| property | 
port:int  [read-only] | Runtime Versions: | AIR 1.0 | 
The port being monitored.
    public function get port():int| () | Constructor | 
public function SocketMonitor(host:String, port:int)| Runtime Versions: | AIR 1.0 | 
Creates a SocketMonitor object for a specified TCP endpoint.
After creating a SocketMonitor 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 SocketMonitor object. Otherwise, the runtime deletes the object and monitoring ends.
Parametershost:String — The host to monitor.
	  | |
port:int — The port to monitor.
	 
	  | 
| () | method | 
override protected function checkStatus():void| Runtime Versions: | AIR 1.0 | 
	Calling the checkStatus() method of a SocketMonitor object causes
	the application to try connecting to the socket, to check for a 
	connect event.
	
	
| () | method | 
override public function toString():String| Runtime Versions: | AIR 1.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.
String — A string representation of the object.
	 
	  |