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

es.tid.netManager.TCPOSPFSender Maven / Gradle / Ivy

The newest version!
package es.tid.netManager;

import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.Socket;
import java.util.LinkedList;
import java.util.concurrent.LinkedBlockingQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import es.tid.ospf.ospfv2.OSPFv2LinkStateUpdatePacket;

public class TCPOSPFSender extends Thread {

	/**
	 * Queue to read the messages to send to the PCE peer
	 */
	private LinkedBlockingQueue sendingQueue;
	private LinkedList sockList;
	private LinkedList out;
	Logger log=LoggerFactory.getLogger("OSPFParser");

	public TCPOSPFSender(LinkedList dirPCEList, LinkedList portList){
		if ((dirPCEList ==null)||(portList==null))
			log.error("Error: Empty list (dirPCEList or portList) in TCPOSPFSender.");
		if (dirPCEList.size() != portList.size())
			log.warn("Error: dirPCEList and portList with different size in TCPOSPFSender.");
		sendingQueue= new LinkedBlockingQueue();
		sockList=new LinkedList();
		out=new LinkedList();
		
		for (int i=0;i getSendingQueue() {
		return sendingQueue;
	}


	public void setSendingQueue(LinkedBlockingQueue sendingQueue) {
		this.sendingQueue = sendingQueue;
	}



	
//	public Inet4Address readPCEAddress(){
//
//		try {
//			return (Inet4Address) Inet4Address.getByName(vntmParams.getNetworkEmulatorPCEAddress().getHostAddress());
//		} catch (UnknownHostException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//
//		return null;
//	}

//	public int readOSPFTCPPort(){
//
//		// FIXME: Definir procedimiento de lectura de puerto
//
//		return vntmParams.getVNTMPort();
//
//	}
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy