Coder Social home page Coder Social logo

socketio.jscore's Introduction

SocketIO.JSCore

SocketIO v1.0.x via JavaScriptCore

Why?

Socket.IO v1.0.0 is a major refactoring of the popular real-time framework. Unfortunatelly the communication protocal has changed drastically, thus most of the existing obj-c library won't work with v1.0.x.

This project is aimed for a obj-c bridge to the official framework via JavaScriptCore.

Design

------------------------------
|      socket.io obj-c       |
------------------------------
            ⬆ ⬇
------------------------------
| UIWebView + JavaScriptCore |
------------------------------
            ⬆ ⬇
------------------------------
|    socket.io JavaScript    |
------------------------------

Installation

platform :ios, '7.0'
pod 'SocketIO'

Usage

#import "SocketIO.h"

// This library is heavily inspired by the event emitter API of the official client
// Both SocketIO and Socket class are event emitter.
SocketIO *io = [[SocketIO alloc] init];

[io once:@"ready" listener:^{
    Socket *socket = [io of:@"http://localhost:8000" and:@{}];
    [socket once:@"hi" listener:^{
        // recieved response from server
    }];
    [socket emit:@"hi", nil];

    [socket emit:@"giveMeDataViaAck", @{@"test": @true}, ^(id *data) {
        // got response
    }, nil];
}];

See test suite for more code samples.

Further Readings

Development

cd Test
npm install
pod install
open ../SocketIO.xcworkspace
npm start

Licence

MIT

socketio.jscore's People

Contributors

hden avatar

Stargazers

Clang avatar Lova avatar Marcin Jekot avatar rayanyang avatar Matteo Padovano avatar Andrés Kwan Orjuela avatar 洪盟翔 avatar Salva avatar Superbil avatar Patrick Perini avatar Ken Vermeille avatar  avatar Kain avatar Parker Wightman avatar  avatar Giacomo Saccardo avatar

Watchers

Marcin Jekot avatar James Cloos avatar Jonathan Lott avatar  avatar Ryan Hestin avatar Matteo Padovano avatar  avatar

Forkers

nicoster

socketio.jscore's Issues

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.