Ejemplo n.º 1
0
func (self *Shout) Open() error {
	/* Opens the shout instance */
	err := C.shout_open(self.shout)
	if err != 0 {
		return self.createShoutError()
	}
	return nil
}
Ejemplo n.º 2
0
func (s *Shout) Open() (chan<- []byte, error) {
	s.LazyInit()

	errcode := int(C.shout_open(s.struc))
	if errcode != C.SHOUTERR_SUCCESS {
		return nil, ShoutError{
			Code:    errcode,
			Message: s.GetError(),
		}
	}

	go s.handleStream()

	return s.stream, nil
}