client

package
v0.0.0-...-1fee6d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2014 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package client defines a set of structs and methods to handle a POP3 client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Parent       *net.Listener //The client's parent listener.
	Conn         net.Conn      //The client's network connection.
	Start        time.Time     //The connection start time.
	End          time.Time     //The connection end time.
	KeepOpen     bool          //Whether to keep Process() looping or not.
	TimeoutTimer *time.Timer   //Timer to check whether the connection times out.
}

Stores objects and data necessary to handle a POP3 client.

func MakeClient

func MakeClient(parent *net.Listener, conn net.Conn) *Client

Creates a Client struct ready to be used, given a parent network listener and a network connection.

func (*Client) LocalEP

func (c *Client) LocalEP() string

Returns a string representing a client's connection local endpoint, complete of IP address and port.

func (*Client) Process

func (c *Client) Process()

Loops and processes the client's commands, until something changes its Client's KeepOpen property to false, the client QUITs the session, or it encounters an error trying to read/write on the connection.

func (*Client) RemoteEP

func (c *Client) RemoteEP() string

Returns a string representing a client's connection remote endpoint, complete of IP address and port.

func (*Client) Send

func (c *Client) Send(s string) error

Sends a line of text, usually obtained from the execution of a POP3 command. Already appends the CRLF (0x0a 0x0d) termination octet pair.

func (*Client) Timeout

func (c *Client) Timeout()

Checks its client handler for POP3 timeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL