public Server(TextReader tr, TextWriter tw, BuzzerLayerBuilder b) { Debug.WriteLine("Server.Server()\t(constructor)\tCalled with" + tr + " & " + tw + " & " + b); pipe = null; r = tr; w = tw; sourceSource = b; source = sourceSource(); source.setCallback(new Callback(buzzerInput)); }
/** * Create a new Server to communicate on stream s with buzzers * wrapped by b. * @param s the stream to work on * @param b the interface to the buzzers */ public Server(Stream s, BuzzerLayerBuilder b) { Debug.WriteLine("Server.Server()\t(constructor)\tCalled with" + s + " & " + b); pipe = s; r = new StreamReader(s); w = new StreamWriter(s); sourceSource = b; source = sourceSource(); source.setCallback(new Callback(buzzerInput)); }