public final class NetConnection extends AbstractNetConnection implements INetConnection
NetConnection - implementation of the INetConnection interface.INetConnection.ConfigurationINetConnection.IListener, INetConnection.ListenerAdapterCALL_BADVERSION, CALL_FAILED, CONNECT_APPSHUTDOWN, CONNECT_BANDWIDTH, CONNECT_CLOSED, CONNECT_FAILED, CONNECT_INVALID_APPLICATION, CONNECT_REJECTED, CONNECT_SUCCESS, defaultObjectEncoding, PROXY_TYPE_BEST, PROXY_TYPE_CONNECT, PROXY_TYPE_HTTP, PROXY_TYPE_NONE| Constructor and Description | 
|---|
NetConnection()
Constructor. 
 | 
NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration)
Constructor. 
 | 
NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration,
             java.util.concurrent.ExecutorService dispatcher,
             java.util.concurrent.ScheduledExecutorService scheduler)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addHeader(java.lang.String operation,
         boolean mustUnderstand,
         java.lang.Object param)
Adds a context header to the AMF packet structure. 
 | 
void | 
call(java.lang.String command,
    Responder responder,
    java.lang.Object... args)
Invokes a command or method on the server, or on an application server,
 to which the application instance is connected. 
 | 
void | 
close()
Closes the connection. 
 | 
void | 
connect(java.lang.String url,
       java.lang.Object... args)
Opens a connection to a server. 
 | 
boolean | 
connected()
Checks if it is connected to the server. 
 | 
java.lang.String | 
connectedProxyType()
If a successful connection is made, indicates the method that was used to
 make it: a direct connection, the CONNECT method, or HTTP tunneling. 
 | 
INetStream | 
createNetStream()
Creates  
INetStream instance. | 
ISharedObject | 
createSharedObject(java.lang.String name,
                  boolean persistent)
Creates  
ISharedObject instance. | 
java.lang.String | 
farID()
Returns the identifier of the Flash Media Server instance to which this Flash Player or Adobe AIR instance is connected. 
 | 
java.lang.String | 
farNonce()
A value chosen substantially by Flash Media Server, unique to this connection. 
 | 
ProtocolLayerInfo | 
getInfo()
Returns connection info (read/written bytes/packets). 
 | 
int | 
getUploadBufferSize()
Returns upload buffer size. 
 | 
int | 
maxPeerConnections()
Returns total number of inbound and outbound peer connections that this instance allows. 
 | 
void | 
maxPeerConnections(int connections)
Sets total number of inbound and outbound peer connections that this instance allows. 
 | 
java.lang.String | 
nearID()
Returns the identifier of this Flash Player or Adobe AIR instance for this NetConnection instance. 
 | 
java.lang.String | 
nearNonce()
A value chosen substantially by this Flash Player or Adobe AIR instance, unique to this connection. 
 | 
void | 
onBWDone()
'onBWDone' invoked by FMS server. 
 | 
void | 
onBWDone(java.lang.Object... args)
'onBWDone' invoked by FMS server. 
 | 
void | 
setMaxUploadBandwidth(int bandwidth)
Sets max upload bandwidth (in bytes per second). 
 | 
static void | 
setSwfFileSizeAndHash(java.util.Map<java.lang.String,java.lang.Object> configuration,
                     java.io.File swf)
Sets  
INetConnection.Configuration.SWF_HASH and INetConnection.Configuration.SWF_SIZE values using
 swf file. | 
java.util.List<? extends INetStream> | 
unconnectedPeerStreams()
An object that holds all of the peer subscriber NetStream objects that are not associated with publishing NetStream objects. 
 | 
boolean | 
usingTLS()
Indicates whether a secure connection was made using native
 Transport Layer Security (TLS) rather than HTTPS. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEventListener, client, client, configuration, objectEncoding, objectEncoding, proxyType, proxyType, removeEventListener, uripublic NetConnection()
public NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration)
configuration - connection configurationpublic NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration,
             java.util.concurrent.ExecutorService dispatcher,
             java.util.concurrent.ScheduledExecutorService scheduler)
configuration - connection configurationdispatcher - dispatcherscheduler - schedulerpublic static void setSwfFileSizeAndHash(java.util.Map<java.lang.String,java.lang.Object> configuration,
                         java.io.File swf)
                                  throws java.lang.Exception
INetConnection.Configuration.SWF_HASH and INetConnection.Configuration.SWF_SIZE values using
 swf file.configuration - swf - SWF filejava.lang.Exception - if an exception occurredpublic void addHeader(java.lang.String operation,
             boolean mustUnderstand,
             java.lang.Object param)
INetConnectionaddHeader in interface INetConnectionoperation - identifies the header and the object data associated with itmustUnderstand - (default = false) — A value of
 true indicates that the server must understand and process
 this header before it handles any of the following headers or messages.param - (default = null) — any objectpublic void call(java.lang.String command,
        Responder responder,
        java.lang.Object... args)
INetConnectioncall in interface INetConnectioncommand - commandresponder - an optional object that is used to handle return values from the serverargs - command argumentspublic void close()
INetConnectionclose in interface INetConnectionpublic void connect(java.lang.String url,
           java.lang.Object... args)
INetConnectionconnect in interface INetConnectionurl - url to connectargs - connection argumentspublic boolean connected()
INetConnectionconnected in interface INetConnectiontrue if connected; false otherwisepublic java.lang.String connectedProxyType()
INetConnectionconnectedProxyType in interface INetConnectionpublic boolean usingTLS()
INetConnectionusingTLS in interface INetConnectionpublic java.lang.String farID()
INetConnectionpublic java.lang.String farNonce()
INetConnectionpublic int maxPeerConnections()
INetConnectionpublic void maxPeerConnections(int connections)
INetConnectionpublic java.lang.String nearID()
INetConnectionpublic java.lang.String nearNonce()
INetConnectionpublic java.util.List<? extends INetStream> unconnectedPeerStreams()
INetConnectionpublic INetStream createNetStream()
INetConnectionINetStream instance.createNetStream in interface INetConnectionINetStream instancepublic ISharedObject createSharedObject(java.lang.String name, boolean persistent)
INetConnectionISharedObject instance.createSharedObject in interface INetConnectionname - shared object namepersistent - persistent flagISharedObject instancepublic ProtocolLayerInfo getInfo()
INetConnectiongetInfo in interface INetConnectionpublic int getUploadBufferSize()
INetConnectiongetUploadBufferSize in interface INetConnectionpublic void setMaxUploadBandwidth(int bandwidth)
INetConnection Note:
 
 - you can change max upload bandwidth after connection is established
 only if INetConnection.Configuration.MAX_UPLOAD_BANDWIDTH configuration property
 was set positive before connection is established.
setMaxUploadBandwidth in interface INetConnectionbandwidth - max upload bandwidthpublic void onBWDone()
public void onBWDone(java.lang.Object... args)
args - arguments