パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.1

socket_io

JS/Node ライブラリ Socket.io のポート。リアルタイム、双方向、イベント駆動型の通信をクロスプラットフォームで可能にします。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
1550
いいね数
134
Pub ポイント
130

パッケージをインストール

flutter pub add socket_io

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Socket.IOは、人気のあるJavaScript/Node.jsのSocket.IOライブラリのDart版であり、プラットフォーム間でリアルタイム、双方向、イベント駆動型の通信を可能にします。WebSocketおよびフォールバックトランスポートをサポートしており、チャットアプリ、共同作業ツール、ライブダッシュボードなど、ライブアップデートが必要なアプリケーションに最適です。このパッケージはFlutterとシームレスに統合されており、Android、iOS、macOS、Windows、Linuxで一貫した動作を提供します。イベント発行、ルーム管理、接続処理が簡単に実現できます。

用途

  • リアルタイムチャットアプリケーション
  • ライブデータ同期
  • 共同編集ツール
  • IoTデバイスのモニタリング
  • マルチプレイヤーゲームネットワーキング

主な機能

  • クロスプラットフォームWebSocketサポート
  • イベントベースの通信
  • 自動トランスポートフォールバック
  • ルームおよびネームスペース管理
  • 発信およびリスニングのためのシンプルな API

適している対象

  • リアルタイムWebおよびモバイルアプリ
  • ライブ更新が必要なアプリケーション
  • Socket.IOに精通した開発者
  • 低遅延通信を必要とするプロジェクト

注意事項

  • 互換性のあるサーバーが必要(例:Node.js Socket.IO)
  • ファイアウォール用に追加の設定が必要になる場合があります
  • パフォーマンスはネットワーク状態に依存します
  • 最適化なしでは、高周波・低遅延シナリオには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

socket.io-dart

Port of awesome JavaScript Node.js library - Socket.io v2.0.1 - in Dart

Usage

import 'package:socket_io/socket_io.dart';

main() {
    var io = new Server();
    var nsp = io.of('/some');
    nsp.on('connection', (client) {
      print('connection /some');
      client.on('msg', (data) {
        print('data from /some => $data');
        client.emit('fromServer', "ok 2");
      });
    });
      io.on('connection', (client) {
        print('connection default namespace');
        client.on('msg', (data) {
          print('data from default => $data');
          client.emit('fromServer', "ok");
        });
      });
      io.listen(3000);
}
// JS client
var socket = io('http://localhost:3000');
socket.on('connect', function(){console.log('connect')});
socket.on('event', function(data){console.log(data)});
socket.on('disconnect', function(){console.log('disconnect')});
socket.on('fromServer', function(e){console.log(e)});
// Dart client
import 'package:socket_io_client/socket_io_client.dart' as IO;

IO.Socket socket = IO.io('http://localhost:3000');
socket.on('connect', (_) {
  print('connect');
  socket.emit('msg', 'test');
});
socket.on('event', (data) => print(data));
socket.on('disconnect', (_) => print('disconnect'));
socket.on('fromServer', (_) => print(_));

Multiplexing support

Same as Socket.IO, this project allows you to create several Namespaces, which will act as separate communication channels but will share the same underlying connection.

Room support

Within each Namespace, you can define arbitrary channels, called Rooms, that sockets can join and leave. You can then broadcast to any given room, reaching every socket that has joined it.

Transports support

Refers to engine.io

  • polling: XHR / JSONP polling transport.
  • websocket: WebSocket transport.

Adapters support

Notes to Contributors

Fork socket.io-dart

If you'd like to contribute back to the core, you can fork this repository and send us a pull request, when it is ready.

If you are new to Git or GitHub, please read this guide first.

Who Uses

  • Quire - a simple, collaborative, multi-level task management tool.
  • KEIKAI - a web spreadsheet for Big Data.

Socket.io Dart Client

Contributors

  • Thanks @felangel for https://github.com/rikulo/socket.io-dart/issues/7
  • Thanks @ThinkDigitalSoftware for https://github.com/rikulo/socket.io-dart/pull/15
  • Thanks @guilhermecaldas for https://github.com/rikulo/socket.io-dart/pull/16
  • Thanks @jodinathan for https://github.com/rikulo/socket.io-dart/pull/17
  • Thanks @jodinathan for https://github.com/rikulo/socket.io-dart/pull/18
  • Thanks @nicobritos for https://github.com/rikulo/socket.io-dart/pull/46
  • Thanks @nicobritos for https://github.com/rikulo/socket.io-dart/pull/47

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。