GithubHelp home page GithubHelp logo

skynet_package's Introduction

What's this ?

It's a example to show how to split the packages from a tcp data stream in skynet.

service/socket_proxyd.lua is a manager service of sockets, and lualib/socket_proxy.lua is the library. Read the test/main.lua for usecase.

If you want to manage a tcp data stream, you can call proxy.subscribe(fd) first. It register the fd into the manager (the unique service socket_proxyd) , and launch a C service for it to split the tcp data stream.

proxy.read(fd) would request a package (WORD in big endian + DATA) from the C service.

proxy.write(fd) would forward the package to the tcp socket.

These C services haven't list in debug console, but you can call info by socket_proxyd in debug console to show these services.

Build

Modify the Makefile, change SKYNET_PATH to your path of skynet. The default path is $(HOME)/skynet .

If you are not using linux, make it by yourself.

Test

Run skynet first :

$(HOME)/skynet test/config

And then use the simple client in ./test :

lua test/client.lua

The test/main.lua is a simple echo server, so you can try to type something now.

skynet_package's People

Contributors

cloudwu avatar kinbei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.