func New0(a Any, h string, p uint16, o bool) *Imp { // if str.Empty(h) || p >= 1<<16-Port0 { return nil } if a == nil { a = false } x := new(Imp) if tst { println("nchan.New0 started for host", h, "/ port", p) } x.object, x.width = Clone(a), Codelen(a) str.RemSpaces(&h) x.farHost = host.New() if !x.farHost.Defined(h) { errh.Error("Hostname "+h+" is not resolvable", 0) Stop(pack, 1) } x.isServer = host.Local(h) x.server = h x.port = Port0 + p x.oneOne = o if x.oneOne { if x.isServer { x.isServer = first(x.port) } else { x.isServer = x.farHost.Sonstewas() } } x.buf = make([]byte, x.width) // x.info = true if tst { println("nchan.New0 for host", h, "is done") } return x }
func New() *Imp { // return &Imp{host.New(), 0, 0} }