All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lritdcs.lrit2damsnt.DamsNtMsgSvrThread Maven / Gradle / Ivy

Go to download

A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.

The newest version!
package lritdcs.lrit2damsnt;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

import ilex.net.BasicSvrThread;

public class DamsNtMsgSvrThread extends BasicSvrThread
{
	/** The socket output stream. */
	private OutputStream outs;

	protected DamsNtMsgSvrThread(DamsNtMsgSvr parent, Socket socket)
		throws IOException
	{
		super(parent, socket);
		outs = socket.getOutputStream();
	}

	@Override
	protected void serviceClient()
	{
		try { sleep(1000L); }
		catch (InterruptedException e) {}
	}
	
	public void sendToClient(byte[] msg)
		throws IOException
	{
		// Send the data to the client
		try
		{
			outs.write(msg);
			outs.flush();
		}
		catch(Exception ex)
		{
			throw new IOException("Error sending data: " + ex);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy