Skip to content
/ moc Public

mini but extensiable online communicate system(Server on Linux, Client on Linux, macos, ios, android...)

Notifications You must be signed in to change notification settings

bigml/moc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moc
=== - mini but extensiable online communication system,
      we use it on our game mobile app.
      most codes stolen from nmdb, clearsilver... thanks them a lot.


design
------
    Based on nmdb, one server can hold multi backend module
    (per module: one plugin, one message queue, one thread);

    And, one module can exist on many process or many servers
    for load share.

    consider doc/net-skeleton.png and the codes for more information.


directory
---------
    moc/
    |-- server             server daemon code (only tested on GNU/Linux)
    |-- plugin             server application logic module code
    |-- client             client API code (tested on Linux, ios, android)
    |   `-- clearsilver    client API depend on clearsilver's util library
    |-- conf               configration file
    |-- demo               simple application demo(use client API)
    `-- doc                documentation



depend
------
    The server depend on cmoon's mnl library currently. so, use
    git clone --recurese https://github.com/bigml/moc.git to use moc.
    and do the rest compile fuck, then, every thing goes ok.

    Client is very easy to compile (use make client),
    gcc, xcode, ndk can compile client directory to a static library.
    Take a look on client/Makefile first, you need to manually define
    some macros like EVENTLOOP, std=c99... on non-Linux enviorment.

    And then, compile the chat demo, modify mocclient.hdf config file,
    run it, hack it, have fun!



multi app dev
-------------
    Following steps can hold multiply application develop at the same time.
    Which seprated public and application code clearly.
        (MOC_PATH hold the moc public base code.
         appx hold the x application's logic code.
         you can mkdir appy, appz, ...)

    0 (e.g. appx)
    -
    mkdir appx;
    cd appx;

    1
    -
    ln -s MOC_PATH/server .
    ln -s MOC_PATH/client .

    cp -rf MOC_PATH/conf .
    cp MOC_PATH/Makefile .

    cp -rf MOC_PATH/plugin .
    cd plugin/; rm skeleton_*; ln -s MOC_PATH/plugin/skeleton* .
    cd private/; rm skeleton_*; ln -s MOC_PATH/plubin/private/skeleton* .

    mkdir demo;
    cd demo;
    ln -s MOC_PATH/demo/Makefile .
    ln -s MOC_PATH/demo/*.c .
    ln -s ../conf/mocclient.hdf .

About

mini but extensiable online communicate system(Server on Linux, Client on Linux, macos, ios, android...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages