Tcl Speed Test 0.0
|
This class implements the Tcl Speed Test Server. More...
Public Member Functions | |
TclSpeedTestServer (name,...) | |
~TclSpeedTestServer () | |
HttpdRead () | |
HttpdRespond () | |
HttpdError (code) | |
Httpd_Log (reason,...) | |
SendRandomTextData (bytes) | |
Static Private Member Functions | |
static | LogPuts (level, message) |
static | HttpdAccept (newsock, ipaddr, remport) |
static | HttpdDate (clicks) |
static | randomprintable () |
Private Attributes | |
state | |
proto | |
url | |
query | |
mime | |
Static Private Attributes | |
static | version |
static | defaultport |
static | port |
static | bindhost |
static | default |
static | bufsize |
static | sockblock |
static | host |
static | defaultlogfilename |
static | logfilename |
static | defaultpidfilename |
static | pidfilename |
static | listen |
static | accepts |
static | testbuffer |
static | logchan |
static | HttpdErrors |
static | HttpdErrorFormat |
This class implements the Tcl Speed Test Server.
* The static members implement global initialization and the listener. The class instances are client connections.
Adapted from the simple HTTPD server that is included in sdx, by Stephen Uhler / Brent Welch (c) 1996 Sun Microsystems.
Main changes: 1) Hardwired the data. This server never touches the file system, except for a PID file and a log file. It never serves files and does no CGI or cookies, etc. It only sends random data in 1, 2, 4, 8, 16, 32, etc. megabyte chunks. 2) It does nothing with the POST or GET query, but will accept an arbitrary abount of data uploaded.
Basicaly it is a like /dev/random (GET) and /dev/null (POST). And I reimplemented the server to use a SNIT type object instead of global variables and upvar.
TclSpeedTestServer::TclSpeedTestServer | ( | name | , |
... | |||
) |
Create a connection object.
... | options:
|
TclSpeedTestServer::~TclSpeedTestServer | ( | ) |
Destory (close) a connection.
TclSpeedTestServer::Httpd_Log | ( | reason | , |
... | |||
) |
Log an Httpd transaction.
reason | The reason for the log message. |
... | Additional arguments. |
static TclSpeedTestServer::HttpdAccept | ( | newsock | , |
ipaddr | , | ||
remport | |||
) | [static, private] |
Accept a connection.
newsock | Connection socket. |
ipaddr | Remote IP address. |
remport | Remote port. |
static TclSpeedTestServer::HttpdDate | ( | clicks | ) | [static, private] |
Generate a date string in HTTP format.
clicks | Current time in seconds. |
TclSpeedTestServer::HttpdError | ( | code | ) |
Display (send) a error message.
code | HTTP error code. |
TclSpeedTestServer::HttpdRead | ( | ) |
Read from a connection.
TclSpeedTestServer::HttpdRespond | ( | ) |
Respond to a request.
static TclSpeedTestServer::LogPuts | ( | level | , |
message | |||
) | [static, private] |
Log output function.
level | Level of log message. |
message | The message text. |
static TclSpeedTestServer::randomprintable | ( | ) | [static, private] |
Generate a random printable character.
TclSpeedTestServer::SendRandomTextData | ( | bytes | ) |
Send some random data.
bytes | The number of bytes to send. |
TclSpeedTestServer::accepts [static, private] |
Accept count.
TclSpeedTestServer::bindhost [static, private] |
The host or ip to bind to (-bindhost CLI option).
TclSpeedTestServer::bufsize [static, private] |
The buffer size.
TclSpeedTestServer::default [static, private] |
The default path.
TclSpeedTestServer::defaultlogfilename [static, private] |
Default log file name.
TclSpeedTestServer::defaultpidfilename [static, private] |
Default pid file name.
TclSpeedTestServer::defaultport [static, private] |
The default port.
TclSpeedTestServer::host [static, private] |
Advertised host name.
TclSpeedTestServer::HttpdErrorFormat [static, private] |
Error format string.
TclSpeedTestServer::HttpdErrors [static, private] |
Http error messages.
TclSpeedTestServer::listen [static, private] |
Listen socket.
TclSpeedTestServer::logchan [static, private] |
Log channel.
TclSpeedTestServer::logfilename [static, private] |
Log file name.
TclSpeedTestServer::mime [private] |
Mime headers.
TclSpeedTestServer::pidfilename [static, private] |
Pid file name.
TclSpeedTestServer::port [static, private] |
The actual port (-port CLI option).
TclSpeedTestServer::proto [private] |
The protocol (GET or POST)
TclSpeedTestServer::query [private] |
The query string.
TclSpeedTestServer::sockblock [static, private] |
Socket blocking or not.
TclSpeedTestServer::state [private] |
The current state.
TclSpeedTestServer::testbuffer [static, private] |
Test buffer.
TclSpeedTestServer::url [private] |
The local part of the URL.
TclSpeedTestServer::version [static, private] |
The version string.