Skip to content

nailcui/sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sim

sim is a simple network application framework.

feature

  • framework
    • tcp server
    • tcp client
    • new byte buffer
    • avoid java nio bug
    • performance testing
  • codec
  • experimental project

example

echo server

  Server server = Server.tcp(10010);
  server.handler(new ServerHandler());
  server.start();

echo client

  Server server = Server.tcp(10010);
  server.handler(new ServerHandler());
  server.start();

redis client

  Client client = new Client(new RedisClientHandler());
  client.tail("0.0.0.0", 6379);
  client.async();

  Scanner input = new Scanner(System.in);

  while (true) {
    String command = input.nextLine();
    if (command == null || command.trim().length() == 0) {
      continue;
    }
    client.send(Command.fromString(command));
  }

About

a simple network application framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages