바뀜

둘러보기로 가기 검색하러 가기
편집 요약 없음
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에서 코드를 담아 상황에 맞게 작동, 반환한다.
 
|}
 
|}
  

둘러보기 메뉴