MCPcopy Index your code
hub / github.com/txthinking/brook / TCPHandle

Method TCPHandle

wsserver.go:193–203  ·  view source on GitHub ↗
(ss Exchanger)

Source from the content-addressed store, hash-verified

191}
192
193func (s *WSServer) TCPHandle(ss Exchanger) error {
194 rc, err := DialTCP("tcp", "", ss.Dst())
195 if err != nil {
196 return err
197 }
198 defer rc.Close()
199 if err := ss.Exchange(rc); err != nil {
200 return nil
201 }
202 return nil
203}
204
205func (s *WSServer) UDPHandle(ss Exchanger) error {
206 rc, err := NATDial("udp", ss.Src(), ss.Dst(), ss.Dst())

Callers 1

ServeHTTPMethod · 0.95

Calls 3

DstMethod · 0.65
ExchangeMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected