Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hsshss committed Oct 25, 2020
1 parent 9bfdca2 commit 027abd7
Show file tree
Hide file tree
Showing 5 changed files with 451 additions and 502 deletions.
9 changes: 8 additions & 1 deletion src/net/nbug/hexprobe/server/telnet/EasyTelnetServer.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package net.nbug.hexprobe.server.telnet;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.Charset;

/**
* EasyTelnetServer
Expand Down Expand Up @@ -98,7 +101,11 @@ public ClientWorker(Socket sock) {
@Override
public void run() {
try {
TelnetTerminal telnet = new TelnetTerminal(sock.getOutputStream(), sock.getInputStream());
TelnetTerminal telnet =
new TelnetTerminal(
new DataOutputStream(sock.getOutputStream()),
new DataInputStream(sock.getInputStream()),
Charset.forName("UTF-8"));
if (prompt != null) {
telnet.setPrompt(prompt);
}
Expand Down
1 change: 1 addition & 0 deletions src/net/nbug/hexprobe/server/telnet/EasyTerminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public interface EasyTerminal {
void close() throws IOException;
InputStream getInputStream();
Charset getEncoding();
void setPrompt(String prompt);
boolean isEcho();
void setEcho(boolean enable);
boolean isLogMode();
Expand Down
16 changes: 0 additions & 16 deletions src/net/nbug/hexprobe/server/telnet/OnClearScreenListener.java

This file was deleted.

Loading

0 comments on commit 027abd7

Please sign in to comment.