telnet

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: BSD-3-Clause Imports: 12 Imported by: 4

Documentation

Overview

Package telnet provides a transport layer for communicating with a JNOS BBS over a network. The Open function, if successful, returns a Transport that can be passed to jnos.Connect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(bbsAddress, mailbox, password string, log io.Writer) (c *jnos.Conn, err error)

Connect connects to the JNOS BBS at bbsAddress (host:port). It logs into the specified BBS mailbox with the specified password. If log is non-nil, all traffic on the connection is written to the log.

Types

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

Transport is the KPC 3 Plus transport to the JNOS BBS.

func Open

func Open(bbsAddress, mailbox, password string, log io.Writer) (t *Transport, err error)

Open connects to the JNOS BBS at bbsAddress (host:port). It logs into the specified BBS mailbox with the specified password. If log is non-nil, all traffic on the connection is written to the log.

func (*Transport) Close

func (t *Transport) Close() error

Close closes the connection to the BBS.

func (*Transport) ReadUntil

func (t *Transport) ReadUntil(until string) (data string, err error)

ReadUntil reads data from the BBS until the specified string is seen, or a timeout occurs. It returns the data that was read (even if it returns an error.)

func (*Transport) ReadUntilT

func (t *Transport) ReadUntilT(until string, timeout time.Duration) (data string, err error)

ReadUntilT reads data from the BBS until the specified string is seen, or the specifiedtimeout occurs. It returns the data that was read (even if it returns an error.)

func (*Transport) Send

func (t *Transport) Send(data string) (err error)

Send sends a string to the BBS.

func (*Transport) UseVerboseReads

func (t *Transport) UseVerboseReads() bool

UseVerboseReads returns whether it's appropriate to use verbose reads when communicating over this transport.

Jump to

Keyboard shortcuts

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