package bramble.networking;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.net.BindException;
import java.net.ServerSocket;
import java.net.Socket;

public class ListenerServer extends ServerSocket {
	
	public ListenerServer(int port) throws IOException, BindException {
		super(port);
	}
	
	synchronized public Message listen() throws Exception {
		
		Socket socket = this.accept();
		
		InputStream inputStream = socket.getInputStream();
		BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
		ObjectInputStream objectInputStream = new ObjectInputStream(bufferedInputStream);
		
		Message output = null;
		
		while(output == null){
			output = (Message) objectInputStream.readObject();
		}
		
		bufferedInputStream.close();
		objectInputStream.close();
		inputStream.close();
		socket.close();
		return output;
	}
}

@@ -41,106 +41,36 @@
 .io.
-BufferedInputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.Object
+IOException;%0Aimport java.io.
 Inpu
@@ -164,16 +164,65 @@
 ocket;%0A%0A
+import org.nustaq.serialization.FSTObjectInput;%0A%0A
 public c
@@ -510,90 +510,11 @@
 ;%0A%09%09
-BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);%0A%09%09
+FST
 Obje
@@ -520,22 +520,16 @@
 ectInput
-Stream
  objectI
@@ -545,16 +545,19 @@
 m = new 
+FST
 ObjectIn
@@ -563,24 +563,10 @@
 nput
-Stream(bufferedI
+(i
 nput
@@ -695,39 +695,8 @@
 %0A%09%09%0A
-%09%09bufferedInputStream.close();%0A
 %09%09ob

Undo incorrect merging of ListenerServer