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

com.github.thorbenkuck.network.connection.ConnectionContext Maven / Gradle / Ivy

The newest version!
package com.github.thorbenkuck.network.connection;

import com.github.thorbenkuck.network.stream.DataStream;
import com.github.thorbenkuck.network.stream.EventStream;

import java.net.SocketAddress;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

public interface ConnectionContext {

	static ConnectionContext map(Connection connection, Supplier supplier, Function convert) {
		return new NativeConnectionContext(connection, supplier, convert);
	}

    void write(Object o);

	DataStream inputStream();

	EventStream outputStream();

	DataStream systemInput();

	EventStream systemOutput();

	String getIdentifier();

	SocketAddress remoteAddress();

	Connection connection();

	void onDisconnect(Consumer consumer);

	void onDisconnect(Runnable runnable);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy