sThread
[ class tree: sThread ] [ index: sThread ] [ all elements ]

Class: sThread_DNS

Source Location: /sThread/sThread/Modules/dns.php

Class Overview


DNS module Class


Author(s):

Copyright:

  • (c) 2015 OOPS.ORG

Variables

Constants

Methods



Class Details

[line 41]
DNS module Class

DNS 모듈에 사용할 수 있는 모듈 option은 다음과 같다.

  • query: 질의할 도메인 또는 IP주소
  • record: 질의할 record type

예제:

  1.    sThread::execute ('kns.kornet.net:53|query=>a.com,record=>A'2'udp');




Tags:

author:  JoungKyun.Kim <http://oops.org>
copyright:  (c) 2015 OOPS.ORG
see:  http://www.freesoft.org/CIE/RFC/1035/39.htm
link:  http://pear.oops.org/package/sThread
license:  BSD


[ Top ]


Class Variables

static $clearsession =

[line 53]

이 변수의 값이 true로 셋팅이 되면, clear_session method를 만들어 줘야 한다. 반대로 false 상태에서는 clear_session method가 존재하지 않아도 상관이 없다.



Tags:

access:  public

Type:   bool


[ Top ]

static $port =

[line 63]

DNS 모듈이 사용하는 기본 포트 번호



Tags:

access:  public

Type:   int


[ Top ]

static $protocol =

[line 58]

DNS 모듈이 사용하는 protocol



Tags:

access:  public

Type:   string


[ Top ]



Class Methods


method call_status [line 176]

int|string call_status( int $status, [boolean $call = false])

현재의 status(integer) 또는 현재 status의 handler 이름을 반환한다.



Tags:

access:  public


Parameters:

int   $status   현재 status
boolean   $call   true로 설정했을 경우 현재 status의 handler 이름을 반환한다.

[ Top ]

method change_status [line 205]

void change_status( boolean &$sess, stdClass $key, int 2)

세션의 상태를 단계로 변경한다.



Tags:

access:  public


Parameters:

int   2   세션 키
boolean   &$sess   변경한 상태가 마지막 단계일 경우 false를 반환한다.
stdClass   $key   sThread 세션 변수 reference

[ Top ]

method check_buf_status [line 147]

int check_buf_status( int $status)

현재 상태가 event read 상태인지 event write 상태인지 를 판단한다.



Tags:

access:  public


Parameters:

int   $status   현재 status

[ Top ]

method clear_session [line 239]

void clear_session( int $key)

session에서 사용한 변수(self::$sess)의 값을 정리한다.

self::$clearsession == false 일 경우, clear_session method 는 존재하지 않아도 된다.




Tags:

access:  public


Parameters:

int   $key   세션 키

[ Top ]

method dns_request [line 288]

void dns_request( stdClass &$sess, int $key)

DNS로 전송할 질의 데이터를 반환



Tags:

access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키

[ Top ]

method dns_response [line 366]

bool|null dns_response( stdClass &$sess, int $key, mixed $recv)

서버의 응답을 확인



Tags:

return:  결과 값은 다음과 같다.
  • true: 모든 전송이 완료
  • false: 전송할 것이 남아 있음. readcallback에서 false를 받으면 status를 유지한다.
  • null: 전송 중 에러 발생
access:  public


Parameters:

stdClass   &$sess   세션 object
int   $key   세션 키
mixed   $recv   read callback에서 전송받은 누적 데이터

[ Top ]

method dns_string [line 515]

void dns_string( $domain)



Parameters:

   $domain  

[ Top ]

method init [line 131]

void init( )

dns 모듈을 초기화 한다.



Tags:

access:  public


[ Top ]

constructor __construct [line 115]

sThread_DNS __construct( )

Class OOP 형식 초기화 메소드



Tags:

access:  public


[ Top ]

method set_last_status [line 223]

void set_last_status( stdClass &$sess, int $key)

세션의 상태를 마지막 단계로 변경한다.



Tags:

access:  public


Parameters:

stdClass   &$sess   sThread 세션 변수 reference
int   $key   세션 키

[ Top ]


Class Constants

DNS_CLOSE =  3

[line 67]



Tags:

access:  public

[ Top ]

DNS_REQUEST =  1

[line 65]



Tags:

access:  public

[ Top ]

DNS_RESPONSE =  2

[line 66]



Tags:

access:  public

[ Top ]



Documentation generated on Tue, 14 May 2019 01:59:43 +0900 by phpDocumentor 1.4.4