alextbg
Published

DIY fully AUTOMATIC and WEBBASED SNOWCANNON

DIY fully AUTOMATIC and WEBBASED SNOWCANNON under 300€ using Arduino UNO, MSP430, ESP8266

AdvancedShowcase (no instructions)383
DIY fully AUTOMATIC and WEBBASED SNOWCANNON

Things used in this project

Story

Read more

Schematics

Schematics platine

Platine for a combined use of the Arduino UNO and the main-controller MSP430F5529

Code

Extract from the server

Java
This i a short extract from our main server. Unfortunately we can't put in the complete code. In total we have around 10.000 lines, written in Java, C, C++, HTML, CSS, JavaScript
public static void main(String[] args) throws IOException {
        server = new ServerSocket(2736);
        if (debug) System.out.println("Serverstart");
        String timeString = time.format(now.getTime()).replace(':', '-');
        String dates[] = date.split("-");
        logWriter = new BufferedWriter(new FileWriter("Server--" + dates[2] + "-" + dates[1] + "-" + dates[0] + "--" + timeString + ".debug"));
        writeToLogfile("Serverstart on " + date.replace('-', '.') + " at " + timeString.replace('-', ':'));
        startDeleteThreadsTimer();
        try {
            loadAccounts();
        } catch (Exception e) {
            if (debug) e.printStackTrace();
        }
        while (run) {
            try {
                Socket client = server.accept();
                client.setSoTimeout(1000 * 60 * 5);
                Thread thread = new Thread(getRunnable(client));
                thread.start();
                threads.add(thread);
                if (debug)
                    System.out.println("new Connection main" + time.format(new GregorianCalendar().getTime()).replace('.', '-') + " " + client.getInetAddress());
                if (debug) System.out.println("Amount Threads" + threads.size());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        server.close();
    }

Credits

alextbg
0 projects • 1 follower

Comments