NAME
Mojo::TFTPd::Connection - A connection class for Mojo::TFTPd
SYNOPSIS
See Mojo::TFTPd
ATTRIBUTES
type
Type of connection rrq or wrq
blocksize
The negotiated blocksize. Default is 512 Byte.
error
Useful to check inside "finish" in Mojo::TFTPd events to see if anything has gone wrong. Holds a string describing the error.
file
The filename the client requested to read or write.
filehandle
This must be set inside the rrq or wrq event or the connection will be dropped. Can be either Mojo::Asset or filehandle.
filesize
This must be set inside the rrq to report "tsize" option if client requested.
If set inside wrq limits maximum upload size. Set automatically on WRQ with "tsize" option.
Can be used inside finish for uploads to check if reported "tsize" and received data length match.
timeout
Retransmit/Inactive timeout.
lastop
Last operation.
mode
Either "netascii", "octet" or empty string if unknown.
peerhost
The IP address of the remote client.
peername
Packet address of the remote client.
retries
Number of times "send_data", "send_ack" or "send_oack" can be retried before the connection is dropped. This value comes from "retries" in Mojo::TFTPd or set inside rrq or wrq events.
retransmit
Number of times last operation ("send_data", "send_ack" or "send_oack") to be retransmitted on timeout before the connection is dropped. This value comes from "retransmit" in Mojo::TFTPd or set inside rrq or wrq events.
Retransmits are disabled if set to 0.
socket
The UDP handle to send data to.
rfc
Contains RFC 2347 options the client has provided. These options are stored in an hash ref.
METHODS
send_data
This method is called when the server sends DATA to the client.
receive_ack
This method is called when the client sends ACK to the server.
receive_data
This method is called when the client sends DATA to the server.
send_ack
This method is called when the server sends ACK to the client.
receive_error
This method is called when the client sends ERROR to the server.
send_error
Used to report error to the client.
send_oack
Used to send RFC 2347 OACK to client
Supported options are
- RFC 2348 blksize - report $self->blocksize
- RFC 2349 timeout - report $self->timeout
- RFC 2349 tsize - report $self->filesize if set inside the rrq
send_retransmit
Used to retransmit last packet to the client.
AUTHOR
Jan Henning Thorsen - jhthorsen@cpan.org