All pastes #472799 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-05 20:36 UTC
rendered paste body
try
			{
				//set current board to the default board
				currentBoard = (int[][])defaultBoard.clone();
				
				//data streams from socket
				out = socket.getOutputStream();
				in = socket.getInputStream();
				
				//wraps data streams for ease of use
				inStream = new BufferedReader(new InputStreamReader(in));
				outStream = new PrintWriter(out, true);
				
				//wrapper for object stream
				objectStream = new ObjectOutputStream(out);
				
				//initial communication to client
				System.out.println("p-" + playerNumber);
				outStream.println("p-" + playerNumber);
				
				outStream.flush();
				out.flush();
				
				System.out.println(currentBoard[1][1]);
				objectStream.writeObject(currentBoard);
				System.out.println(currentBoard[1][1]);
				
				objectStream.flush();
				out.flush();
			}
			catch(IOException ioe)
			{
				System.out.println(ioe.getMessage());
			}