Code example for UnknownHostException

Methods: toString

0
	private void connectToBot() { 
		try { 
			robotSocket = new Socket(robotHostName, robotHostPort);
			robotOutputStream = robotSocket.getOutputStream();
		} catch (UnknownHostException e) {
			alert(e.toString());
		} catch (IOException e) {
			alert(e.toString());
		} 
	} 
 
	public byte[] intToByteArray(int value) {
		return new byte[] { (byte) value, (byte) (value >>> 8),
				(byte) (value >>> 16), (byte) (value >>> 24) };
	} 
 
	private void sendMessage(String message) {
		try { 
			connectToBot(); 
			robotOutputStream.write(message.getBytes());
			robotOutputStream.flush();