주 메뉴 열기
대문
임의의 문서로
로그인
설정
Pywiki 소개
면책 조항
Pywiki
검색
바뀜
← 이전 편집
다음 편집 →
장고 실시간 채팅(Channels와 redis server 이용)
(편집)
2022년 11월 6일 (일) 16:19 판
405 바이트 추가됨
,
2022년 11월 6일 (일) 16:19
편집 요약 없음
492번째 줄:
492번째 줄:
await self.accept()
await self.accept()
</syntaxhighlight>
</syntaxhighlight>
+
|-
+
|서브프로토콜
+
|서브프로토콜을 지정해 연결할 수도 있다.
+
|self.accept('subprotocol")
+
<nowiki>#</nowiki> self.scope['subprotocols'] 을 통해 관련 정보를 알 수 있다.
|}
|}
513번째 줄:
518번째 줄:
await self.channel_layer.group_discard(self.group_name, self.channel_name)
await self.channel_layer.group_discard(self.group_name, self.channel_name)
</syntaxhighlight>
</syntaxhighlight>
+
|-
+
|종료에러코드
+
|receive에서 특정 과정을 거쳐 self.close(code=1234) 등으로 커스텀에러를 낼 수도 있다.
+
|disconnect에서 코드를 담아 상황에 맞게 작동, 반환한다.
|}
|}
Sam
사무관
,
인터페이스 관리자
,
관리자
, 교사
편집
1,408
번