当前位置: 首页 > news >正文

网站平台系统设计公司wordpress语言包下载地址

网站平台系统设计公司,wordpress语言包下载地址,企业网站设计要点,西安企业建站大家如果对使用netty搞这些http请求什么的感兴趣的#xff0c;可以参观我自己创建的这个项目。 nanshaws/nettyWeb: 复习一下netty#xff0c;并打算做一个web项目出来 (github.com) Redis的基本命令包括#xff1a; SET key value#xff1a;设置指定key的值。 GET key…大家如果对使用netty搞这些http请求什么的感兴趣的可以参观我自己创建的这个项目。 nanshaws/nettyWeb: 复习一下netty并打算做一个web项目出来 (github.com) Redis的基本命令包括 SET key value设置指定key的值。 GET key获取指定key的值。 DEL key删除指定key。 EXISTS key检查指定key是否存在。 TTL key获取指定key的过期时间。 KEYS pattern查找所有符合指定模式的key。 INCR key将指定key的值增加1。 DECR key将指定key的值减少1。 LPUSH key value将值添加到列表的左侧。 RPUSH key value将值添加到列表的右侧。 LPOP key移除并返回列表左侧的值。 RPOP key移除并返回列表右侧的值。 SADD key member将成员添加到集合中。 SMEMBERS key获取集合中的所有成员。 ZADD key score member将成员添加到有序集合中。 ZRANGE key start stop按照分数从小到大的顺序获取有序集合中指定范围的成员。 HSET key field value将哈希表中指定字段的值设置为指定值。 HGET key field获取哈希表中指定字段的值。 HMGET key field1 [field2]获取哈希表中指定字段的值列表。 PING测试Redis服务器是否可用。 用netty操作redis 引入依赖 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdorg.tianfan/groupIdartifactIdnettyTestLearn/artifactIdversion1.0-SNAPSHOT/versionpropertiesmaven.compiler.source17/maven.compiler.sourcemaven.compiler.target17/maven.compiler.targetproject.build.sourceEncodingUTF-8/project.build.sourceEncoding/propertiesdependenciesdependencygroupIdio.netty/groupIdartifactIdnetty-transport-native-epoll/artifactIdversion4.1.70.Final/version/dependencydependencygroupIdio.netty/groupIdartifactIdnetty-all/artifactIdversion4.1.86.Final/version/dependencydependencygroupIdjakarta.activation/groupIdartifactIdjakarta.activation-api/artifactIdversion2.1.2/version/dependencydependencygroupIdorg.eclipse.angus/groupIdartifactIdangus-mail/artifactIdversion1.0.0/version/dependencydependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdversion8.0.33/version/dependencydependencygroupIdorg.mybatis/groupIdartifactIdmybatis/artifactIdversion3.5.10/version/dependencydependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdversion1.18.30/version/dependency!-- json--dependencygroupIdcom.google.code.gson/groupIdartifactIdgson/artifactIdversion2.8.9/version/dependency/dependencies/project 完整代码 package org.tianfan.example;import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.util.concurrent.GenericFutureListener;import java.io.BufferedReader; import java.io.InputStreamReader;public class RedisClient {String host; // 目标主机int port; // 目标主机端口public RedisClient(String host,int port){this.host host;this.port port;}public void start() throws Exception{EventLoopGroup group new NioEventLoopGroup();try {Bootstrap bootstrap new Bootstrap();bootstrap.group(group).channel(NioSocketChannel.class).handler(new RedisClientInitializer());Channel channel bootstrap.connect(host, port).sync().channel();System.out.println( connected to host : host , port : port);System.out.println( type rediss command to communicate with redis-server or type quit to shutdown );BufferedReader in new BufferedReader(new InputStreamReader(System.in));ChannelFuture lastWriteFuture null;for (;;) {String s in.readLine();if(s.equalsIgnoreCase(quit)) {break;}System.out.print();lastWriteFuture channel.writeAndFlush(s);lastWriteFuture.addListener(new GenericFutureListenerChannelFuture() {Overridepublic void operationComplete(ChannelFuture future) throws Exception {if (!future.isSuccess()) {System.err.print(write failed: );future.cause().printStackTrace(System.err);}}});}if (lastWriteFuture ! null) {lastWriteFuture.sync();}System.out.println( bye );}finally {group.shutdownGracefully();}}public static void main(String[] args) throws Exception{RedisClient client new RedisClient(192.168.56.10,6379);client.start();}}package org.tianfan.example;import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; import io.netty.handler.codec.CodecException; import io.netty.handler.codec.redis.*; import io.netty.util.CharsetUtil; import io.netty.util.ReferenceCountUtil;import java.util.ArrayList; import java.util.List;public class RedisClientHandler extends ChannelDuplexHandler {// 发送 redis 命令Overridepublic void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {String[] commands ((String) msg).split(\\s);ListRedisMessage children new ArrayList(commands.length);for (String cmdString : commands) {children.add(new FullBulkStringRedisMessage(ByteBufUtil.writeUtf8(ctx.alloc(), cmdString)));}RedisMessage request new ArrayRedisMessage(children);ctx.write(request, promise);}// 接收 redis 响应数据Overridepublic void channelRead(ChannelHandlerContext ctx, Object msg) {RedisMessage redisMessage (RedisMessage) msg;// 打印响应消息printAggregatedRedisResponse(redisMessage);// 是否资源ReferenceCountUtil.release(redisMessage);}Overridepublic void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {System.err.print(exceptionCaught: );cause.printStackTrace(System.err);ctx.close();}private static void printAggregatedRedisResponse(RedisMessage msg) {if (msg instanceof SimpleStringRedisMessage) {System.out.println(((SimpleStringRedisMessage) msg).content());} else if (msg instanceof ErrorRedisMessage) {System.out.println(((ErrorRedisMessage) msg).content());} else if (msg instanceof IntegerRedisMessage) {System.out.println(((IntegerRedisMessage) msg).value());} else if (msg instanceof FullBulkStringRedisMessage) {System.out.println(getString((FullBulkStringRedisMessage) msg));} else if (msg instanceof ArrayRedisMessage) {for (RedisMessage child : ((ArrayRedisMessage) msg).children()) {printAggregatedRedisResponse(child);}} else {throw new CodecException(unknown message type: msg);}}private static String getString(FullBulkStringRedisMessage msg) {if (msg.isNull()) {return (null);}return msg.content().toString(CharsetUtil.UTF_8);}}package org.tianfan.example;import io.netty.channel.Channel; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.redis.RedisArrayAggregator; import io.netty.handler.codec.redis.RedisBulkStringAggregator; import io.netty.handler.codec.redis.RedisDecoder; import io.netty.handler.codec.redis.RedisEncoder;public class RedisClientInitializer extends ChannelInitializerChannel {Overrideprotected void initChannel(Channel ch) throws Exception {ChannelPipeline pipeline ch.pipeline();pipeline.addLast(new RedisDecoder());pipeline.addLast(new RedisBulkStringAggregator());pipeline.addLast(new RedisArrayAggregator());pipeline.addLast(new RedisEncoder());pipeline.addLast(new RedisClientHandler());} }结果图
http://www.hkea.cn/news/14368013/

相关文章:

  • vue大型网站怎么做路由家具设计图制作软件
  • 做网站销售那里找客户互联网舆情报告
  • 网站开发岗位绿色食品网站建设论文
  • 马鞍山网站建设电话中国建设银行手机银行下载官方网站
  • 广州网站设计报价网络公司开发软件的人是叫it
  • 佛山乐从网站建设php自己写框架做网站
  • 网站运营工作的基本内容简述如何对网站进行推广
  • 如何做网站淘客易购商城网站怎么做啊
  • 阳江公司做网站学生网页设计作品欣赏
  • 做网站l价格屏蔽 wordpress 插件下载
  • 企业免费网站推广公司课程介绍网站建设ppt模板
  • 小型网站设计及建设论文文献织梦系统网站首页空白
  • 怎么制作网站教程步骤佛山专业网站建设公司推荐
  • 如何建设网站济南兴田德润简介电话微信公众平台设计
  • 做外贸的阿里巴巴网站是哪个桂林同城网站
  • 企业门户网站数据库设计西安网上进行公司
  • 成都企业网站建设介绍网站建设 创新
  • 让别人访问我的网站wordpress 去除logo
  • 怎么欣赏一个网站设计图房地产网站编辑
  • 庐山市建设规划局网站亳州网站建设费用
  • 网站的开发工具有哪些网站建设专题
  • 购物商城网站的运营vs设置网站开发环境
  • 大连网站建设要多少钱湖北建设厅官方网站
  • 有些网站仿出问题js网站统计代码
  • wordpress j建站网络营销渠道的功能包括
  • 百度推广包做网站吗iis发布网站后无法加载dll
  • 中小企业网站官网六安网站优化
  • a做爰网站p2p网站开发
  • 网站关键词排名优化软件网页设计与制作思考建议200字
  • 穹拓网站建设vps主机上新增网站