add logicface: UnixStreamTransport

This commit is contained in:
free will
2021-04-16 15:38:18 +08:00
parent d1a1336f37
commit d162429ffb
@@ -0,0 +1,32 @@
package logicface;
import java.io.IOException;
import java.nio.channels.SocketChannel;
/*
* @Author: Wang Feng
* @Description:
* @Version: 1.0.0
* @Date: 15:37 2021/4/16
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
*/
public class UnixStreamTransport extends StreamTransport{
/**
* 初始化UnixStreamTransport
* @param channel
*/
public void init(SocketChannel channel) throws LogicFaceException {
try {
this.channel=channel;
this.localAddr=channel.getLocalAddress().toString();
this.localUri="unix://"+this.localAddr;
this.remoteAddr=channel.getRemoteAddress().toString();
this.remoteUri="unix://"+this.remoteAddr;
this.recvBuf=new byte[1024*1028*4];
this.recvLen=0;
} catch (IOException e) {
throw new LogicFaceException("TcpTransport.init: "+e.getMessage());
}
}
}