Skip to content

Get Started with Spider

Gilbok Lee edited this page Jun 27, 2014 · 17 revisions

Get started with Spider

코드네임 Spider는 Hive5 SDK의 실시간(Realtime)기능 지원을 부르는 말입니다.

초기화(Initialize)

Hive5Client는 이미 초기화되어 있다고 가정합니다.

Hive5Spider spider = new Hive5Spider(Hive5Spider.Instance);

서버연결(Connect)

아래와 같이 호출하면 서버에 연결합니다.

spider.Connect(OnConnected);

콜백함수의 예는 아래와 같습니다.

private void OnConnected(bool success)
{
    // spider.SessionId 등에 유효한 값이 들어있을 것입니다.
}

채널 목록 가져오기(GetChannels )

아래와 같이 호출합니다.

spider.GetChannels(OnGetChannels);

콜백함수의 예는 아래와 같습니다.

private void OnGetChannels(bool success, CallResult result)
{
    GetChannelsResult getChannelsResult = result as GetChannelsResult;
    // getChannelsResult.Channels 에 접근이 가능합니다.
}

Clone this wiki locally