// Subscribe registers to all passed addresses.
// Parameter addresses is a string of addresses.
// It returns the result.
Subscribe registers to all passed addresses.
Parameter addresses is a string of addresses.
It returns the result.
// Subscribe registers to all passed addresses . // Parameter addresses is a string of addresses . // It returns the result .
func (s *Subscription) Subscribe(addresses ...string) Result {
	cId := C.CString(s.id)
	size := C.size_t(unsafe.Sizeof((*C.char)(nil)))
	length := C.size_t(len(addresses))
	cAddresses := (**C.char)(C.malloc(length * size))
	cAddressView := (*[1 << 30]*C.char)(unsafe.Pointer(cAddresses))[0:len(addresses):len(addresses)]
	defer func() {
		C.free(unsafe.Pointer(cId))
	}()
	for i, address := range addresses {
		cAddressView[i] = C.CString(address)
	}
	result := C.DLR_clientSubscribeMultiSync(s.client, cId, cAddresses, C.uint(len(addresses)))
	if result == 0 {
		s.mx.Lock()
		for _, address := range addresses {
			s.addresses[address] = struct{}{}
		}
		s.mx.Unlock()
	}
	return Result(result)
}
func ( s * Subscription ) Subscribe ( addresses ... string ) Result { cId := C . CString ( s . id ) size := C . size_t ( unsafe . Sizeof ( ( * C . char ) ( nil ) ) ) length := C . size_t ( len ( addresses ) ) cAddresses := ( * * C . char ) ( C . malloc ( length * size ) ) cAddressView := ( * [ 1 << 30 ] * C . char ) ( unsafe . Pointer ( cAddresses ) ) [ 0 : len ( addresses ) : len ( addresses ) ] defer func ( ) { C . free ( unsafe . Pointer ( cId ) ) } ( ) for i , address := range addresses { cAddressView [ i ] = C . CString ( address ) } result := C . DLR_clientSubscribeMultiSync ( s . client , cId , cAddresses , C . uint ( len ( addresses ) ) ) if result == 0 { s . mx . Lock ( ) for _ , address := range addresses { s . addresses [ address ] = struct { } { } } s . mx . Unlock ( ) } return Result ( result ) }
Subscribe registers to all passed addresses.
Subscribe registers to all passed addresses .