패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.1

socket_io

JS/Node 라이브러리 Socket.io의 포트입니다. 실시간, 양방향 및 이벤트 기반 통신을 다중 플랫폼에서 가능하게 합니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
1.6천
좋아요
134
Pub 점수
130

패키지 설치

flutter pub add socket_io

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Socket.IO는 인기 있는 JavaScript/Node.js Socket.IO 라이브러리의 Dart 버전으로, 플랫폼 간 실시간, 양방향 및 이벤트 기반 통신을 가능하게 합니다. WebSocket과 백업 전송 방식을 지원하여 채팅 앱, 협업 도구 또는 실시간 대시보드와 같은 실시간 업데이트가 필요한 애플리케이션에 적합합니다. 이 패키지는 Flutter와 원활하게 통합되어 Android, iOS, macOS, Windows, Linux에서 일관된 동작을 제공합니다. 이벤트 발행, 방 관리, 연결 처리를 쉽게 제공합니다.

사용 사례

  • 실시간 채팅 애플리케이션
  • 실시간 데이터 동기화
  • 협업 편집 도구
  • 사물인터넷 장치 모니터링
  • 멀티플레이어 게임 네트워킹

주요 기능

  • 크로스 플랫폼 WebSocket 지원
  • 이벤트 기반 통신
  • 자동 전송 백업
  • 룸 및 네임스페이스 관리
  • 발신 및 수신을 위한 간단한 API

적합한 대상

  • 실시간 웹 및 모바일 앱
  • 실시간 업데이트가 필요한 애플리케이션
  • 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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.