本文整理汇总了Java中org.apache.mina.filter.codec.textline.LineDelimiter.CRLF属性的典型用法代码示例。如果您正苦于以下问题:Java LineDelimiter.CRLF属性的具体用法?Java LineDelimiter.CRLF怎么用?Java LineDelimiter.CRLF使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.mina.filter.codec.textline.LineDelimiter
的用法示例。
在下文中一共展示了LineDelimiter.CRLF属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MinaCubeClient
public MinaCubeClient(String hostname, int port) {
this.hostname = hostname;
this.port = port;
connector = new NioSocketConnector(1);
connector.setConnectTimeoutMillis(2000);
connector.getFilterChain().addLast("logger", new LoggingFilter());
TextLineCodecFactory codecFactory = new TextLineCodecFactory(UTF_8, LineDelimiter.CRLF, LineDelimiter.AUTO);
codecFactory.setDecoderMaxLineLength(4096);
codecFactory.setEncoderMaxLineLength(4096);
connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(codecFactory));
handler = new ConnectHandler();
connector.setHandler(handler);
}
示例2: start
public void start() throws IOException {
// enable for debug
acceptor.getFilterChain().addLast("logger", new LoggingFilter());
TextLineCodecFactory codecFactory = new TextLineCodecFactory(UTF_8, LineDelimiter.CRLF, LineDelimiter.CRLF);
acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(codecFactory));
acceptor.setHandler(handler);
acceptor.bind(new InetSocketAddress(0) );
acceptor.setCloseOnDeactivation(true);
logger.info("Cube server bound to [{}]", acceptor.getLocalAddress());
}
示例3: IT100Encoder
public IT100Encoder() {
super(Charset.forName("US-ASCII"), LineDelimiter.CRLF);
}
示例4: IT100Decoder
public IT100Decoder() {
super(Charset.forName("US-ASCII"), LineDelimiter.CRLF);
}
示例5: SmtpMessageFactory
/**
* Creates a new instance with the current default {@link Charset},
* the {@link LineDelimiter#CRLF} delimiter.
*/
public SmtpMessageFactory()
{
this(Charset.defaultCharset(), LineDelimiter.CRLF);
}
示例6: SMTPCodecFactory
/**
* Creates a new instance using the configuration.
*/
protected SMTPCodecFactory(Charset charset, int dataDeferredSize)
{
encoder = new TextLineEncoder(charset, LineDelimiter.CRLF);
decoder = new SMTPDecoder(charset, dataDeferredSize);
}