MCPcopy
hub / github.com/txthinking/brook / UDPHandle

Method UDPHandle

wsserver.go:205–215  ·  view source on GitHub ↗
(ss Exchanger)

Source from the content-addressed store, hash-verified

203}
204
205func (s *WSServer) UDPHandle(ss Exchanger) error {
206 rc, err := NATDial("udp", ss.Src(), ss.Dst(), ss.Dst())
207 if err != nil {
208 return err
209 }
210 defer rc.Close()
211 if err := ss.Exchange(rc); err != nil {
212 return nil
213 }
214 return nil
215}
216
217func (s *WSServer) Shutdown() error {
218 return s.HTTPServer.Shutdown(context.Background())

Callers 1

ServeHTTPMethod · 0.95

Calls 4

SrcMethod · 0.65
DstMethod · 0.65
ExchangeMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected