Stream¶
-
public class
Stream¶ The class representing Carrier stream.
Fields¶
Methods¶
closeChannel¶
-
public void
closeChannel(int channel)¶ Close a new channel on multiplexing stream. If the stream is not multiplexing this function will throw exception.
- Parameters
channel – The channel ID to close
- Throws
closePortForwarding¶
-
public void
closePortForwarding(int portForwarding)¶ Close a port forwarding. If the stream is not multiplexing this function will throw exception.
- Parameters
portForwarding – The portforwarding ID.
- Throws
getTransportInfo¶
-
public TransportInfo
getTransportInfo()¶ Get tranport info of carrier stream.
- Returns
The transport info of this stream.
getType¶
-
public StreamType
getType()¶ Get the carrier stream type.
- Returns
The stream type defined in StreamType.
openChannel¶
openPortFowarding¶
-
public int
openPortFowarding(String service, PortForwardingProtocol protocol, String host, String port)¶ Open a port forwarding to remote service over multiplexing. If the stream is not multiplexing this function will throw exception.
- Parameters
service – The remote service name
protocol – Port forwarding protocol
host – Local host or ip to binding If host is null, port forwarding will bind to localhost
port – Local port to binding, can not be nil.
- Throws
- Returns
Port forwarding ID
pendChannel¶
-
public void
pendChannel(int channel)¶ Request remote peer to pend channel data sending. If the stream is not multiplexing this function will throw exception.
- Parameters
channel – The channel ID
- Throws
resumeChannel¶
-
public void
resumeChannel(int channel)¶ Request remote peer to resume channel data sending. If the stream is not multiplexing this function will throw exception.
- Parameters
channel – The channel ID
- Throws
writeData¶
-
public int
writeData(byte[] data, int offset, int len)¶ Send outgoing data to remote peer. If the stream is in multiplexing mode, application can not call this function to send data. If this function is called on multiplexing mode stream, it will throw exception.
- Parameters
data – The outgoing data offset The start offset len The bytes to write
- Throws
- Returns
Bytes of data sent on success
writeData¶
-
public int
writeData(byte[] data)¶ Send outgoing data to remote peer. If the stream is in multiplexing mode, application can not call this function to send data. If this function is called on multiplexing mode stream, it will throw exception.
- Parameters
data – The outgoing data
- Throws
- Returns
Bytes of data sent on success
writeData¶
-
public int
writeData(byte data)¶ Send outgoing data to remote peer. If the stream is in multiplexing mode, application can not call this function to send data. If this function is called on multiplexing mode stream, it will throw exception.
- Parameters
data – The outgoing data
- Throws
- Returns
Bytes of data sent on success
writeData¶
-
public int
writeData(int channel, byte[] data, int offset, int len)¶ Send outgoing data to remote peer. If the stream is not multiplexing this function will throw exception.
- Parameters
channel – [in] The channel ID
data – [in] The outgoing data offset [in] The start offset len [in] The bytes to write
- Returns
Bytes of data sent on success.