class OFConnection implements IOFConnection, IOFConnectionBackend {

	@Override
	public Collection<OFMessage> write(final Iterable<OFMessage> msgList) {
		if (!isConnected()) {
			if (logger.isDebugEnabled())
				logger.debug(this.toString() + " : not connected - dropping {} element msglist {} ",
						Iterables.size(msgList),
						String.valueOf(msgList).substring(0, 80));
			return IterableUtils.toCollection(msgList);
		}
		for (OFMessage m : msgList) {			
			if (logger.isTraceEnabled()) {
				logger.trace("{}: send {}", this, m);
				counters.updateWriteStats(m);
			}
		}
		this.channel.eventLoop().execute(new WriteMessageTask(msgList));
		return Collections.emptyList();
	}

	public  OFConnection(@Nonnull DatapathId dpid,
			@Nonnull OFFactory factory,
			@Nonnull Channel channel,
			@Nonnull OFAuxId auxId,
			@Nonnull IDebugCounterService debugCounters,
			@Nonnull Timer timer);

}