Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents 499baba + 9808d78 commit 3859206d09df184bfc2325d5376de290c6ed82db @yomguy committed May 8, 2012
Showing with 5 additions and 30 deletions.
  1. +2 −2 README.rst
  2. +0 −11 server.conf.sample
  3. +1 −8 src/StreamingServer.java
  4. +2 −9 src/org/czentral/minihttp/MiniHTTP.java
View
4 README.rst
@@ -63,8 +63,8 @@ stream name). So you will end up with something like::
java -cp lib/stream-m.jar StreamingServer server.conf
-HTTP ACCESS
-============
+HTTP ACCES
+==========
Streams are identified by a name. The program refers to this as StreamID or
streamname. Note that the < and > characters are used just to signal that
View
11 server.conf.sample
@@ -5,17 +5,6 @@
# Syntactic elements (words) can be separated by linear whitepace.
#
-# server.bindAddress
-# example: 127.0.0.1, 192.168.1.1
-# localhost. www.example.com also work
-server.bindAddress = localhost
-
-# server.backlog
-# connection queue
-# defaults to 100 if not set
-# server.backlog = 100
-
-
# server.port
# listening port
server.port = 8080
View
9 src/StreamingServer.java
@@ -67,15 +67,8 @@ private static void loadConfig(String filename) {
public void run() {
String serverPort = settings.get("server.port");
- String serverBindAddress = settings.get("server.bindAddress");
- String serverBackLog = settings.get("server.backlog");
- //default to 100 if not set
- if (serverBackLog == null){
- serverBackLog = "100";
- }
-
System.out.println("Stating server on port: " + serverPort);
- MiniHTTP server = new MiniHTTP(Integer.parseInt(serverPort), Integer.parseInt(serverBackLog), serverBindAddress);
+ MiniHTTP server = new MiniHTTP(Integer.parseInt(serverPort));
PublisherResource publish = new PublisherResource();
server.registerResource("/publish", publish);
View
11 src/org/czentral/minihttp/MiniHTTP.java
@@ -32,26 +32,19 @@
public class MiniHTTP extends Thread {
protected int port;
- protected int backlog;
-
- //bind address or hostname
- protected String bindAddress;
protected Map<String,HTTPResource> resources = new HashMap<String,HTTPResource>();
- public MiniHTTP(int port, int backlog, String bindAddress) {
+ public MiniHTTP(int port) {
super();
this.port = port;
- this.backlog = backlog;
- this.bindAddress = bindAddress;
-
}
public void run() {
ServerSocket sock = null;
try {
- sock = new ServerSocket(port, backlog, InetAddress.getByName(bindAddress));
+ sock = new ServerSocket(port);
} catch (IOException e) {
throw new RuntimeException("MiniHTTP can not listen on given port: " + port);
}

0 comments on commit 3859206

Please sign in to comment.