public interface INetConnection
INetConnection
- RTMP(E)/RTMPT(E)/RTMPS connection (replica of ActionScript's
NetConnection class interface).Modifier and Type | Interface and Description |
---|---|
static class |
INetConnection.Configuration
Configuration - INetConnection configuration constants. |
static interface |
INetConnection.IListener
IListener - NetConnection listener. |
static class |
INetConnection.ListenerAdapter
ListenerAdapter - INetConnection.IListener adapter. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CALL_BADVERSION
The URI specified in the NetConnection.connect method did not
specify 'rtmp' as the protocol.
|
static java.lang.String |
CALL_FAILED
The NetConnection.call method was not able to invoke the server-side method or
command.
|
static java.lang.String |
CONNECT_APPSHUTDOWN
The application has been shut down (for example, if the application is out of
memory resources and must shut down to prevent the server from crashing) or the server has shut down.
|
static java.lang.String |
CONNECT_BANDWIDTH
Connection bandwidth.
|
static java.lang.String |
CONNECT_CLOSED
The connection was closed successfully
|
static java.lang.String |
CONNECT_FAILED
The connection attempt failed.
|
static java.lang.String |
CONNECT_INVALID_APPLICATION
The application name specified during connect is invalid.
|
static java.lang.String |
CONNECT_REJECTED
The client does not have permission to connect to the application, the
application expected different parameters from those that were passed,
or the application name specified during the connection attempt was not found on
the server.
|
static java.lang.String |
CONNECT_SUCCESS
The connection attempt succeeded.
|
static ObjectEncoding |
defaultObjectEncoding
Default object encoding.
|
static java.lang.String |
PROXY_TYPE_BEST
PROXY_TYPE_BEST - "best" |
static java.lang.String |
PROXY_TYPE_CONNECT
PROXY_TYPE_CONNECT - "CONNECT" |
static java.lang.String |
PROXY_TYPE_HTTP
PROXY_TYPE_HTTP - "HTTP" |
static java.lang.String |
PROXY_TYPE_NONE
PROXY_TYPE_NONE - "none" |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(INetConnection.IListener listener)
Registers an event listener.
|
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.
|
java.lang.Object |
client()
Returns the object on which callback methods should be invoked.
|
void |
client(java.lang.Object client)
Sets the object on which callback methods should be invoked.
|
void |
close()
Closes the connection.
|
java.util.Map<java.lang.String,java.lang.Object> |
configuration()
Returns NetConnection configuration.
|
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. |
ProtocolLayerInfo |
getInfo()
Returns connection info (read/written bytes/packets).
|
int |
getUploadBufferSize()
Returns upload buffer size.
|
ObjectEncoding |
objectEncoding()
Returns object encoding.
|
void |
objectEncoding(ObjectEncoding encoding)
The object encoding (AMF version).
|
java.lang.String |
proxyType()
Returns proxy type.
|
void |
proxyType(java.lang.String type)
Determines whether native SSL is used for RTMPS instead of HTTPS,
and whether the CONNECT method of tunneling is used to connect through a proxy server.
|
void |
removeEventListener(INetConnection.IListener listener)
Removes the listener.
|
void |
setMaxUploadBandwidth(int bandwidth)
Sets max upload bandwidth (in bytes per second).
|
java.lang.String |
uri()
The URI of the application server that was passed to
connect(String, Object[]) ,
if connect(String, Object[]) was used to connect to a server. |
boolean |
usingTLS()
Indicates whether a secure connection was made using native
Transport Layer Security (TLS) rather than HTTPS.
|
static final java.lang.String PROXY_TYPE_NONE
PROXY_TYPE_NONE
- "none"static final java.lang.String PROXY_TYPE_HTTP
PROXY_TYPE_HTTP
- "HTTP"static final java.lang.String PROXY_TYPE_CONNECT
PROXY_TYPE_CONNECT
- "CONNECT"static final java.lang.String PROXY_TYPE_BEST
PROXY_TYPE_BEST
- "best"static final java.lang.String CALL_FAILED
static final java.lang.String CALL_BADVERSION
static final java.lang.String CONNECT_APPSHUTDOWN
static final java.lang.String CONNECT_CLOSED
static final java.lang.String CONNECT_FAILED
static final java.lang.String CONNECT_REJECTED
static final java.lang.String CONNECT_SUCCESS
static final java.lang.String CONNECT_INVALID_APPLICATION
static final java.lang.String CONNECT_BANDWIDTH
Note:
This event is introduced in the JUV RTMP Client library and not available in
ActionScript/FMS interaction.
static final ObjectEncoding defaultObjectEncoding
void client(java.lang.Object client)
client
- the object on which callback methods should be invokedjava.lang.Object client()
boolean connected()
true
if connected; false
otherwisejava.lang.String connectedProxyType()
ObjectEncoding objectEncoding()
void objectEncoding(ObjectEncoding encoding)
encoding
- object encodingjava.lang.String proxyType()
void proxyType(java.lang.String type)
type
- proxy typejava.lang.String uri()
connect(String, Object[])
,
if connect(String, Object[])
was used to connect to a server.boolean usingTLS()
void addHeader(java.lang.String operation, boolean mustUnderstand, java.lang.Object param)
operation
- 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 objectvoid call(java.lang.String command, Responder responder, java.lang.Object... args)
command
- commandresponder
- an optional object that is used to handle return values from the serverargs
- command argumentsvoid connect(java.lang.String url, java.lang.Object... args)
url
- url to connectargs
- connection argumentsvoid close()
void addEventListener(INetConnection.IListener listener)
listener
- listener to addvoid removeEventListener(INetConnection.IListener listener)
listener
- listener to removeINetStream createNetStream()
INetStream
instance.INetStream
instanceISharedObject createSharedObject(java.lang.String name, boolean persistent)
ISharedObject
instance.name
- shared object namepersistent
- persistent flagISharedObject
instancejava.util.Map<java.lang.String,java.lang.Object> configuration()
INetConnection.Configuration
class constants
for configuration properties.ProtocolLayerInfo getInfo()
int getUploadBufferSize()
void setMaxUploadBandwidth(int bandwidth)
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.
bandwidth
- max upload bandwidth