Inherited Variables
Inherited Constants
Inherited Methods
Class Details
SMTP_Server_Socket
Tags:
- author - Jason Johnson <jason@php-smtp.org>
- version - 1.0
- copyright - Copyright (c) 2008, Jason Johnson
- license - The MIT License
[ Top ]
Class Variables
$log
[line 13]
Type: mixed
Overrides:
[ Top ]
$remote_address
[line 15]
Type: mixed
Overrides:
[ Top ]
$socket
[line 14]
Type: mixed
Overrides:
[ Top ]
Class Methods
SMTP_Server_Socket
SMTP_Server_Socket SMTP_Server_Socket(
[resource
$socket = null])
[line 22]
Constructor with an optional argument of a socket resource
Parameters:
- resource $socket - A socket resource as returned by socket_create() or socket_accept()
[ Top ]
accept
[ Top ]
bind
void bind(
string
$host, int
$port)
[line 50]
Binds the socket to a host and port
Parameters:
- string $host - The host to bind the socket to
- int $port - The port on the host to use
[ Top ]
close
void close(
)
[line 137]
Closes the socket
Parameters:
[ Top ]
connect
void connect(
string
$host, [int
$port = 25])
[line 38]
Connects to the the specified $host on $port
Parameters:
- string $host - The host to connect to
- int $port - The port on the host to use, defaults to 25
[ Top ]
listen
void listen(
)
[line 63]
Cause the socket to listen for incoming connections
Parameters:
[ Top ]
read
string read(
)
[line 126]
Reads and returns a default length of bytes from the socket
Parameters:
[ Top ]
remote_address
string remote_address(
)
[line 91]
Returns the address of the remote client or server
Parameters:
[ Top ]
write
void write(
string
$buffer, [
$raw = false])
[line 100]
Writes the supplied buffer to the socket
Parameters:
- string $buffer - The buffer to be written to the socket
- $raw -
[ Top ]
write_file
void write_file(
string
$path)
[line 111]
Writes an entire file to the socket
Parameters:
- string $path - The absolute or relative path of the file
[ Top ]