Package com.iizix.term.comm
Class TelnetComm
java.lang.Object
com.iizix.term.comm.TelnetComm
Class to handle the Telnet protocol for 3270 and 5250.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescription- TelnetComm- (SessionInfo sessionInfo, TelnetCommProps properties, boolean is3270, Worker worker, TelnetCommListener listener, SSLEngine engine) Creates a new Telnet Client Communication channel as UNINITIALIZED.
- Method SummaryModifier and TypeMethodDescription- boolean- close()Call this method to close the socket.Gets the codepage converter for EBCDIC characters.Gets the device name of the session.Gets the Telnet properties.Gets the NIO Socket Communication instance.- getState()Gets the state of the connection.Gets the negotiated terminal type, null for none.- booleanChecks 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.
- Constructor Details- TelnetCommpublic TelnetComm- (SessionInfo sessionInfo, TelnetCommProps properties, boolean is3270, Worker worker, TelnetCommListener listener, SSLEngine engine) throws IOException Creates a new Telnet Client Communication channel as UNINITIALIZED.- Parameters:
- 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.
- Throws:
- IOException- for I/O errors.
 
 
- Method Details- getSocketCommNIOGets the NIO Socket Communication instance.- Returns:
- The socket communication instance.
 
- getTerminalTypeGets the negotiated terminal type, null for none.- Returns:
- The terminal type, null for none.
 
- getPropertiesGets the Telnet properties.- Returns:
- The telnet settings.
 
- getCodepageConverterGets the codepage converter for EBCDIC characters.- Returns:
- The codepage converter.
 
- openOpens the communication.- Throws:
- IOException- For I/O errors.
 
- hasBeenOpenpublic boolean hasBeenOpen()Checks if the session has been opened, and if so cannot be reopened but needs to have a new instance.- Returns:
- true if opened.
 
- getStateGets the state of the connection.- Returns:
- Connection state.
 
- isClosedpublic boolean isClosed()Checks if the connection is disposed of.- Returns:
- true for closed.
 
- closepublic boolean close()Call this method to close the socket.- Returns:
- true if closed, false if already closed.
 
- writeWrites a raw buffer to the output followed by a flush.- Parameters:
- buf- Data to send.
- Throws:
- IOException- For send failures.
 
- writeWrites an amount of bytes. The data is appended with and end-of-record (IAC EOR). Each 0xFF character in the buffer is escaped with 0xFF (i.e. IAC IAC).- Parameters:
- buf- The byte array to write.
- n- Count of bytes to write.
- Throws:
- IOException- if an I/O error occurs.
 
- writeRawWrites a raw buffer to the output followed by a flush.- Parameters:
- buf- The byte buffer.
- Throws:
- IOException- for send IO failures.
 
- writeRawWrites a raw buffer to the output followed by a flush.- Parameters:
- buf- The byte buffer.
- count- The count of bytes from beginning of buffer to write.
- Throws:
- IOException- for send IO failures.
 
- getDeviceNameGets the device name of the session.- Returns:
- null if no device name exists.
 
- sendSSCPLUDataSends SSCP LU data for a TN3270E session.- Parameters:
- buf- The buffer.
- n- The count of bytes.
- Throws:
- IOException- if an I/O error occurs.
 
- sendSpecialKeySends TN3270E special key (param=0 is Attention and param=1 is SysReq).- Parameters:
- param- The special send key.
- Returns:
- false if this special key is not supported.
- Throws:
- IOException- if an I/O error occurs.