public class TelnetComm extends Object
Constructor and Description |
---|
TelnetComm(SessionInfo sessionInfo,
TelnetCommProps properties,
boolean is3270,
Worker worker,
TelnetCommListener listener,
SSLEngine engine)
Creates a new Telnet Client Communication channel as UNINITIALIZED.
|
Modifier and Type | Method and Description |
---|---|
boolean |
close()
Call this method to close the socket.
|
CodepageConverter |
getCodepageConverter()
Gets the codepage converter for EBCDIC characters.
|
String |
getDeviceName()
Gets the device name of the session.
|
TelnetCommProps |
getProperties()
Gets the Telnet properties.
|
SocketCommNIO |
getSocketCommNIO()
Gets the NIO Socket Communication instance.
|
SocketCommNIO.State |
getState()
Gets the state of the connection.
|
String |
getTerminalType()
Gets the negotiated terminal type, null for none.
|
boolean |
hasBeenOpen()
Checks if the session has been opened, and if so cannot be reopened but needs to have a new
instance.
|
boolean |
isClosed()
Checks if the connection is disposed of.
|
void |
open()
Opens the communication.
|
boolean |
sendSpecialKey(int param)
Sends TN3270E special key (param=0 is Attention and param=1 is SysReq).
|
void |
sendSSCPLUData(byte[] buf,
int n)
Sends SSCP LU data for a TN3270E session.
|
void |
write(byte[] buf)
Writes a raw buffer to the output followed by a flush.
|
void |
write(byte[] buf,
int n)
Writes an amount of bytes.
|
void |
writeRaw(byte[] buf)
Writes a raw buffer to the output followed by a flush.
|
void |
writeRaw(byte[] buf,
int count)
Writes a raw buffer to the output followed by a flush.
|
public TelnetComm(SessionInfo sessionInfo, TelnetCommProps properties, boolean is3270, Worker worker, TelnetCommListener listener, SSLEngine engine) throws IOException
sessionInfo
- Session information.properties
- The Telnet properties.is3270
- Flag for 3270.worker
- The worker thread for socket processing.listener
- The listener for Telnet events.engine
- The SSL engine, or null for plain socket.IOException
- for I/O errors.public SocketCommNIO getSocketCommNIO()
public String getTerminalType()
public TelnetCommProps getProperties()
public CodepageConverter getCodepageConverter()
public void open() throws IOException
IOException
- For I/O errors.public boolean hasBeenOpen()
public SocketCommNIO.State getState()
public boolean isClosed()
public boolean close()
public void write(byte[] buf) throws IOException
buf
- Data to send.IOException
- For send failures.public void write(byte[] buf, int n) throws IOException
buf
- The byte array to write.n
- Count of bytes to write.IOException
- if an I/O error occurs.public void writeRaw(byte[] buf) throws IOException
buf
- The byte buffer.IOException
- for send IO failures.public void writeRaw(byte[] buf, int count) throws IOException
buf
- The byte buffer.count
- The count of bytes from beginning of buffer to write.IOException
- for send IO failures.public String getDeviceName()
public void sendSSCPLUData(byte[] buf, int n) throws IOException
buf
- The buffer.n
- The count of bytes.IOException
- if an I/O error occurs.public boolean sendSpecialKey(int param) throws IOException
param
- The special send key.IOException
- if an I/O error occurs.iizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.