Skip to content

Commit

Permalink
version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmaanbhav committed Jan 29, 2015
1 parent 3872dc1 commit 3f1733e
Show file tree
Hide file tree
Showing 29 changed files with 2,564 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ayushmaanbhav</groupId>
<artifactId>customquiz</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>CustomQuiz</name>
<description>Quiz application for quiz or public or KBC like events.</description>
<url>http://github.com/ayushmaanbhav/customquiz</url>
<dependencies>
<dependency>
<groupId>uk.co.caprica</groupId>
<artifactId>vlcj</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>platform</artifactId>
<version>3.5.2</version>
</dependency>
</dependencies>
</project>
44 changes: 44 additions & 0 deletions src/main/java/BServer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import java.io.*;
import java.net.*;

public class BServer extends Thread {
protected DatagramSocket socket = null;
private long SECONDS;
public boolean started;
public int port;
public String iip;

public BServer(String ip, int p) {
try {
iip = ip;
port = p;
socket = new DatagramSocket(4445);
SECONDS = 5000;
started = true;
} catch (Exception e) {
}
}

public void run() {
while (started) {
try {
String dString = iip + ":" + port;
byte[] buf = new byte[128];
buf = dString.getBytes();
InetAddress group = InetAddress.getByName("230.0.0.1");
DatagramPacket packet = new DatagramPacket(buf, buf.length,
group, 4447);
socket.send(packet);
System.out.println("sent");
try {
sleep(SECONDS);
} catch (InterruptedException e) {
}
} catch (IOException e) {
e.printStackTrace();
return;
}
}
socket.close();
}
}
11 changes: 11 additions & 0 deletions src/main/java/BasicWindowMonitor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import java.awt.event.*;
import java.awt.Window;

public class BasicWindowMonitor extends WindowAdapter {
public void windowClosing(WindowEvent e) {
Window w = e.getWindow();
w.setVisible(false);
w.dispose();
System.exit(0);
}
}
Loading

0 comments on commit 3f1733e

Please sign in to comment.