// Path: modules/core/src/main/java/com/illposed/osc/OSCPacket.java
// public interface OSCPacket extends Serializable {
// 
// }
// 
// Path: modules/core/src/main/java/com/illposed/osc/OSCSerializeException.java
// public class OSCSerializeException extends Exception {
// 
// 	public OSCSerializeException() {
// 		super();
// 	}
// 
// 	public OSCSerializeException(final String message) {
// 		super(message);
// 	}
// 
// 	public OSCSerializeException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public OSCSerializeException(final Throwable cause) {
// 		super(cause);
// 	}
// }
// 
// Path: modules/core/src/main/java/com/illposed/osc/OSCParseException.java
// public class OSCParseException extends Exception {
// 	private final ByteBuffer data;
// 
// 	public ByteBuffer getData() {
// 		return data;
// 	}
// 
// 	public OSCParseException(final String message, final ByteBuffer data) {
// 		super(message);
// 		this.data = data;
// 	}
// 
// 	public OSCParseException(final Throwable cause, final ByteBuffer data) {
// 		super(cause);
// 		this.data = data;
// 	}
// 
// 	public OSCParseException(
// 		final String message,
// 		final Throwable cause,
// 		final ByteBuffer data)
// 	{
// 		super(message, cause);
// 		this.data = data;
// 	}
// }


import com.illposed.osc.OSCSerializeException;
import com.illposed.osc.OSCParseException;
import java.io.IOException;
import com.illposed.osc.OSCPacket;
// SPDX-FileCopyrightText: 2004-2019 C. Ramakrishnan / Illposed Software
// SPDX-FileCopyrightText: 2021 Robin Vobruba <hoijui.quaero@gmail.com>
//
// SPDX-License-Identifier: BSD-3-Clause

package com.illposed.osc.transport;


/**
 * An interface about sending and receiving OSC packets over a network.
 *
 * Implementations:
 * <ul>
 * <li>{@link com.illposed.osc.transport.udp.UDPTransport}</li>
 * <li>{@link com.illposed.osc.transport.tcp.TCPTransport}</li>
 * </ul>
 */
public interface Transport {

	/**
	 * Converts and sends an OSC packet (message or bundle) to the remote address.
	 * @param packet the bundle or message to be converted and sent
	 * @throws IOException if we run out of memory while converting,
	 *   or a socket I/O error occurs while sending
	 * @throws OSCSerializeException if the packet fails to serialize
	 */
	void send(final OSCPacket packet) throws IOException, OSCSerializeException;

	/**
	 * Receive an OSC packet.
	 * @return the packet received
	 * @throws IOException if an I/O error occurs while trying to read from the
	 * @throws OSCParseException if the packet fails to parse
	 * channel
	 */
	OSCPacket receive() throws IOException, OSCParseException;

// Path: modules/core/src/main/java/com/illposed/osc/OSCPacket.java
// public interface OSCPacket extends Serializable {
// 
// }
// 
// Path: modules/core/src/main/java/com/illposed/osc/OSCSerializeException.java
// public class OSCSerializeException extends Exception {
// 
// 	public OSCSerializeException() {
// 		super();
// 	}
// 
// 	public OSCSerializeException(final String message) {
// 		super(message);
// 	}
// 
// 	public OSCSerializeException(final String message, final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public OSCSerializeException(final Throwable cause) {
// 		super(cause);
// 	}
// }
// 
// Path: modules/core/src/main/java/com/illposed/osc/OSCParseException.java
// public class OSCParseException extends Exception {
// 	private final ByteBuffer data;
// 
// 	public ByteBuffer getData() {
// 		return data;
// 	}
// 
// 	public OSCParseException(final String message, final ByteBuffer data) {
// 		super(message);
// 		this.data = data;
// 	}
// 
// 	public OSCParseException(final Throwable cause, final ByteBuffer data) {
// 		super(cause);
// 		this.data = data;
// 	}
// 
// 	public OSCParseException(
// 		final String message,
// 		final Throwable cause,
// 		final ByteBuffer data)
// 	{
// 		super(message, cause);
// 		this.data = data;
// 	}
// }


// Path: modules/core/src/main/java/com/illposed/osc/transport/Transport.java
import com.illposed.osc.OSCSerializeException;
import com.illposed.osc.OSCParseException;
import java.io.IOException;
import com.illposed.osc.OSCPacket;

// SPDX-FileCopyrightText: 2004-2019 C. Ramakrishnan / Illposed Software
// SPDX-FileCopyrightText: 2021 Robin Vobruba <hoijui.quaero@gmail.com>
//
// SPDX-License-Identifier: BSD-3-Clause

package com.illposed.osc.transport;


/**
 * An interface about sending and receiving OSC packets over a network.
 *
 * Implementations:
 * <ul>
 * <li>{@link com.illposed.osc.transport.udp.UDPTransport}</li>
 * <li>{@link com.illposed.osc.transport.tcp.TCPTransport}</li>
 * </ul>
 */
public interface Transport {

	/**
	 * Converts and sends an OSC packet (message or bundle) to the remote address.
	 * @param packet the bundle or message to be converted and sent
	 * @throws IOException if we run out of memory while converting,
	 *   or a socket I/O error occurs while sending
	 * @throws OSCSerializeException if the packet fails to serialize
	 */
	void send(final OSCPacket packet) throws IOException, OSCSerializeException;

	/**
	 * Receive an OSC packet.
	 * @return the packet received
	 * @throws IOException if an I/O error occurs while trying to read from the
	 * @throws OSCParseException if the packet fails to parse
	 * channel
	 */
	OSCPacket receive() throws IOException, OSCParseException;

	boolean isBlocking();