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

Class: Net_DNS2_Socket

Source Location: /Net_DNS2-1.4.1/Net/DNS2/Socket.php

Class Overview


This is the abstract base class for the two sockets classes; this simply provides the class definition for the two sockets classes.


Author(s):

Variables

Methods


Child classes:

Net_DNS2_Socket_Sockets
Socket handling class using the PHP sockets extension
Net_DNS2_Socket_Streams
Socket handling class using the PHP Streams

Inherited Variables

Inherited Methods


Class Details

[line 74]
This is the abstract base class for the two sockets classes; this simply provides the class definition for the two sockets classes.


[ Top ]


Class Variables

$host =

[line 78]

  • Access: protected

Type:   mixed


[ Top ]

$last_error =

[line 85]

  • Access: public

Type:   mixed


[ Top ]

$local_host =

[line 82]

  • Access: protected

Type:   mixed


[ Top ]

$local_port =

[line 83]

  • Access: protected

Type:   mixed


[ Top ]

$port =

[line 79]

  • Access: protected

Type:   mixed


[ Top ]

$sock =

[line 76]

  • Access: protected

Type:   mixed


[ Top ]

$timeout =

[line 80]

  • Access: protected

Type:   mixed


[ Top ]

$type =

[line 77]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 104]

Net_DNS2_Socket __construct( integer $type, string $host, integer $port, integer $timeout)

constructor - set the port details
  • Access: public

Parameters:

integer   $type   —  the socket type
string   $host   —  the IP address of the DNS server to connect to
integer   $port   —  the port of the DNS server to connect to
integer   $timeout   —  the timeout value to use for socket functions

[ Top ]

__destruct (Destructor)   [line 117]

void __destruct( )

destructor
  • Access: public

[ Top ]

bindAddress   [line 133]

boolean bindAddress( string $address, [mixed $port = 0])

sets the local address/port for the socket to bind to
  • Access: public

Parameters:

string   $address   —  the local IP address to bind to
mixed   $port   —  the local port to bind to, or 0 to let the socket function select a port

[ Top ]

close   [line 157]

boolean close( )

closes a socket connection to the DNS server
  • Abstract:
  • Access: public

Overridden in child classes as:

Net_DNS2_Socket_Sockets::close()
closes a socket connection to the DNS server
Net_DNS2_Socket_Streams::close()
closes a socket connection to the DNS server

[ Top ]

open   [line 148]

boolean open( )

opens a socket connection to the DNS server
  • Abstract:
  • Access: public

Overridden in child classes as:

Net_DNS2_Socket_Sockets::open()
opens a socket connection to the DNS server
Net_DNS2_Socket_Streams::open()
opens a socket connection to the DNS server

[ Top ]

read   [line 180]

mixed read( integer &$size, integer $max_size)

reads a response from a DNS server
  • Return: returns the data on success and false on error
  • Abstract:
  • Access: public

Overridden in child classes as:

Net_DNS2_Socket_Sockets::read()
reads a response from a DNS server
Net_DNS2_Socket_Streams::read()
reads a response from a DNS server

Parameters:

integer   &$size   —  the size of the DNS packet read is passed back
integer   $max_size   —  the max data size returned.

[ Top ]

write   [line 168]

boolean write( string $data)

writes the given string to the DNS server socket
  • Abstract:
  • Access: public

Overridden in child classes as:

Net_DNS2_Socket_Sockets::write()
writes the given string to the DNS server socket
Net_DNS2_Socket_Streams::write()
writes the given string to the DNS server socket

Parameters:

string   $data   —  a binary packed DNS packet

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:01:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.