forked from KNEMC/KLALB
37 lines
1.3 KiB
Java
37 lines
1.3 KiB
Java
package org.kne.cloud.network.klalb;
|
|
|
|
import java.io.IOException;
|
|
import java.net.SocketException;
|
|
import java.nio.ByteBuffer;
|
|
import java.util.List;
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import java.util.concurrent.atomic.LongAdder;
|
|
|
|
import org.kne.cloud.network.MultipurposeSocketAddress;
|
|
|
|
public interface KLALBPacketLink {
|
|
public void setOutputTrafficCounters(LongAdder[] al);
|
|
public void setOutputPacketsCounters(LongAdder[] longAdders);
|
|
public void setInputTrafficCounters(LongAdder[] longAdders);
|
|
public void setInputPacketsCounters(LongAdder[] al);
|
|
public void writePacket(ByteBuffer kp) throws IOException;
|
|
public default void writePackets(ByteBuffer[] kpp,int off,int len) throws IOException {
|
|
for (int i = 0; i < len; i++) {
|
|
writePacket(kpp[off+i]);
|
|
}
|
|
}
|
|
public void writeKLALBPacket(KLALBPacket kp) throws IOException;
|
|
public void flush() throws IOException;
|
|
public KLALBPacket readKLALBPacket()throws IOException;
|
|
public ByteBuffer readPacket()throws IOException;
|
|
public void close() throws IOException;
|
|
public boolean isClosed();
|
|
public void setSoTimeout(int val) throws SocketException;
|
|
public int getSoTimeout() throws SocketException;
|
|
@Override
|
|
public String toString();
|
|
public boolean isStream();
|
|
public void writeKLALBPackets(List<KLALBPacket> kp) throws IOException;
|
|
|
|
}
|