/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package atmsdriver.model;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

/**
 *
 * @author jtorres
 */
class HighwayStatusWriter {
    
    private final String host;
    private final int port;
    
    public HighwayStatusWriter(String host, int port)
    {
        this.host = host;
        this.port = port;
    }
    
    public void write(String xml) throws IOException
    {
        Socket sock = new Socket(host, port);
        PrintWriter out = new PrintWriter(sock.getOutputStream(), true);
        out.println(xml);
        sock.close();
    }
}
