Documentation ¶
Index ¶
- type Upstream
- func (this *Upstream) RecycleDgram(conn *UpstreamTypeDgram)
- func (this *Upstream) RecycleStream(conn *UpstreamTypeStream)
- func (this *Upstream) RecycleTcp(tcpConn UpstreamTcpConn)
- func (this *Upstream) RecycleUdp(udpConn UpstreamUdpConn)
- func (this *Upstream) SelectDgram(key int, dial bool) (*UpstreamTypeDgram, error)
- func (this *Upstream) SelectStream(key int, dial bool) (*UpstreamTypeStream, error)
- func (this *Upstream) SelectTcp(key int, dial bool) (UpstreamTcpConn, error)
- func (this *Upstream) SelectUdp(key int, dial bool) (UpstreamUdpConn, error)
- type UpstreamTcpConn
- type UpstreamTypeDgram
- type UpstreamTypeStream
- type UpstreamUdpConn
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Upstream ¶
func (*Upstream) RecycleDgram ¶
func (this *Upstream) RecycleDgram(conn *UpstreamTypeDgram)
func (*Upstream) RecycleStream ¶
func (this *Upstream) RecycleStream(conn *UpstreamTypeStream)
func (*Upstream) RecycleTcp ¶
func (this *Upstream) RecycleTcp(tcpConn UpstreamTcpConn)
func (*Upstream) RecycleUdp ¶
func (this *Upstream) RecycleUdp(udpConn UpstreamUdpConn)
func (*Upstream) SelectDgram ¶
func (this *Upstream) SelectDgram(key int, dial bool) (*UpstreamTypeDgram, error)
func (*Upstream) SelectStream ¶
func (this *Upstream) SelectStream(key int, dial bool) (*UpstreamTypeStream, error)
func (*Upstream) SelectTcp ¶
func (this *Upstream) SelectTcp(key int, dial bool) (UpstreamTcpConn, error)
Example ¶
package main import ( "fmt" "github.com/goodplayer/asa/core/upstream" ) func main() { up := upstream.Upstream{ List: []string{"tcp://127.0.0.1:8012"}, } conn, err := up.SelectTcp(1) fmt.Println(err, conn.TCPConn.RemoteAddr()) }
Output:
type UpstreamTcpConn ¶
type UpstreamTypeDgram ¶
type UpstreamTypeDgram struct { net.PacketConn Addr string // contains filtered or unexported fields }
type UpstreamTypeStream ¶
type UpstreamUdpConn ¶
Click to show internal directories.
Click to hide internal directories.