コード例 #1
0
  @Override
  public NetServerSpec getObject() throws Exception {
    spec.listen(host, port);

    if (null != framing) {
      if ("linefeed".equals(framing)) {
        spec.codec(new DelimitedCodec(delegateCodec));
      } else if ("length".equals(framing)) {
        spec.codec(new LengthFieldCodec(lengthFieldLength, delegateCodec));
      }
    }

    return spec;
  }
コード例 #2
0
 public NetServerSpecFactoryBean setDispatcher(Dispatcher dispatcher) {
   spec.dispatcher(dispatcher);
   return this;
 }