Permalink
Browse files

Revert to 38cea2e

  • Loading branch information...
1 parent a3b602b commit 9808d7898bd9dd8f84ba23ac8b2857ed072756a3 @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
@@ -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
@@ -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
@@ -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);
@@ -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 9808d78

Please sign in to comment.