Skip to content

Commit 8a18cb6

Browse files
committed
System Touch
1 parent eb61dad commit 8a18cb6

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

source/commons/CommonRails.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import national.NationalDriver;
44
import server.nitro.WebExpress;
55

6+
import java.io.BufferedWriter;
7+
import java.io.IOException;
68
import java.net.Socket;
79
import java.text.SimpleDateFormat;
810
import java.util.ArrayList;
@@ -270,6 +272,20 @@ public static void delayableFinePrinter(String text, int delay)
270272
}
271273
}
272274

275+
public static boolean isConnected(BufferedWriter writer)
276+
{
277+
try
278+
{
279+
writer.flush();
280+
281+
return true;
282+
}
283+
catch (IOException e)
284+
{
285+
return false;
286+
}
287+
}
288+
273289
protected static void _long(final String orgasm, WebExpress web_express, Integer not_less_than)
274290
{
275291
try

source/telnet/TelnetOutputBuilder.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ public void run()
4141

4242
if(!value.isEmpty())
4343
{
44-
CommonRails.printSystemComponent(this, this.hashCode(), "TelnetOutputBuilder Output >> sending message ["+message.toString()+"]");
44+
CommonRails.printSystemComponent(this, this.hashCode(), "TelnetOutputBuilder Output >> sending message ["+value+"]");
4545

46-
proxy.writer.write(value);
46+
if(CommonRails.isConnected(proxy.writer))
47+
proxy.writer.write(value);
4748

48-
proxy.writer.flush();
49+
if(CommonRails.isConnected(proxy.writer))
50+
proxy.writer.flush();
4951

50-
queue.messages.remove(0);
52+
queue.messages.removeFirst();
5153
}
5254
else
5355
{

sources/build.make.md

Whitespace-only changes.

0 commit comments

Comments
 (0)