socket.emit('이벤트 명',{메세지});
현재 연결되어 있는 클라이언트 소켓에 "이벤트명"으로 데이터를 보낸다
socket.on('이벤트 명',function(data){});
현재 연결되어 있는 클라이언트 소켓으로부터 들어오는 '이벤트 명' 데이터를 function(data)에서 처리함
socket.broadcast.emit('이벤트 명', {메세지});
나를 제외한 다른 소켓 클라이언트들에게 이벤트를 보냄
소켓 데이터 바인딩
각 소켓에서 데이터를 바인딩할 수 있음
socket.set('이름','값',function(){});
해당 클라이언트 socket에 이름값으로 값을 저장함
socket.get('이름',값',function(err,value){});
해당 클라이언트 socket에 이름값의 값을 가져온다
socket.del('이름','값',function(err,value){});
해당 클라이언트 socket에 이름값을 지운다.
room 처리 (그룸)
socket.join('룸 이름');
socket.leave('룸 이름');
io.sockets.in('룸 이름').emit('이벤트 명',메세지);
룸에 있는 모든 클라에게 이벤트 명의 이벤트로 메세지 보냄
io.sockets.manager.rooms
모든 룸 리턴
io.sockets.clients('룸 이름');
룸에 있는 클라 리턴
2018년 10월 24일 수요일
flutter 기본 개념 1
Scaffold - 화면 뼈대 역할 - 기본적으로 AppBar body floatingActionButton 같은걸 배치해줌 return Scaffold ( appBar : AppBar ( title : const Text ...
-
Introduction Dynamic Programming (DP) is a fundamental concept in computer science and algorithmic problem-solving. It's a technique tha...
-
Scaffold - 화면 뼈대 역할 - 기본적으로 AppBar body floatingActionButton 같은걸 배치해줌 return Scaffold ( appBar : AppBar ( title : const Text ...
-
도커 상태 확인 현재 실행중인 프로세스 docker ps 실행 했던 프로세스 docker ps -a 설치된 이미지 목록 docker images 도커 이미지 관리 이미지 받아오기 docker pull image이름 이...