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

com.firefly.net.tcp.TcpConnection Maven / Gradle / Ivy

There is a newer version: 5.0.0-dev6
Show newest version
package com.firefly.net.tcp;

import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.Collection;

import com.firefly.net.buffer.FileRegion;
import com.firefly.utils.function.Action0;
import com.firefly.utils.function.Action1;

public interface TcpConnection {

	TcpConnection receive(Action1 buffer);

	TcpConnection exception(Action1 exception);

	TcpConnection write(ByteBuffer byteBuffer, Action0 succeeded, Action1 failed);

	TcpConnection write(ByteBuffer[] byteBuffer, Action0 succeeded, Action1 failed);

	TcpConnection write(Collection byteBuffer, Action0 succeeded, Action1 failed);

	TcpConnection write(String message, Action0 succeeded, Action1 failed);
	
	TcpConnection write(String message, String charset, Action0 succeeded, Action1 failed);

	TcpConnection write(FileRegion file, Action0 succeeded, Action1 failed);

	TcpConnection write(ByteBuffer byteBuffer, Action0 succeeded);

	TcpConnection write(ByteBuffer[] byteBuffer, Action0 succeeded);

	TcpConnection write(Collection byteBuffer, Action0 succeeded);

	TcpConnection write(String message, Action0 succeeded);
	
	TcpConnection write(String message, String charset, Action0 succeeded);

	TcpConnection write(FileRegion file, Action0 succeeded);

	TcpConnection write(ByteBuffer byteBuffer);

	TcpConnection write(ByteBuffer[] byteBuffer);

	TcpConnection write(Collection byteBuffer);

	TcpConnection write(String message);
	
	TcpConnection write(String message, String charset);

	TcpConnection write(FileRegion file);

	Object getAttachment();

	void setAttachment(Object object);

	int getSessionId();

	long getOpenTime();

	long getCloseTime();

	long getDuration();

	long getLastReadTime();

	long getLastWrittenTime();

	long getLastActiveTime();

	long getReadBytes();

	long getWrittenBytes();

	TcpConnection closeCallback(Action0 closeCallback);

	void close();

	void closeNow();

	void shutdownOutput();

	void shutdownInput();

	int getState();

	boolean isOpen();

	InetSocketAddress getLocalAddress();

	InetSocketAddress getRemoteAddress();

	long getIdleTimeout();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy