-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ayushmaanbhav
committed
Jan 29, 2015
1 parent
3872dc1
commit 3f1733e
Showing
29 changed files
with
2,564 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.