mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-06-18 03:40:25 +08:00
add logicface: UnixStreamTransport
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user