Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Lees de berichten in de socket.
- */
- public void run() {
- while(true) {
- try {
- /* Bepaal of er nog een verbinding is */
- if(in == null) {
- try {
- mui.addMessage("<Verbinding is verbroken>");
- mui.exceptionEnable(LOCE_CONNECT_ERROR);
- this.shutdown();
- }
- catch(Exception e) {}
- }
- /* Wacht tot er een nieuw bericht is */
- if(in.ready()) {
- /* Lees het bericht en stuur het naar de command handler */
- String command = in.readLine();
- handleCommands(command);
- }
- } catch(NullPointerException e) {
- } catch (IOException e) {
- /* Vang een IOException af */
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement