示例#1
0
文件: zmq.go 项目: badgerodon/zmq
func MessageInitData(message ZMessage, data []byte) os.Error {
	return handle(C.zmq_msg_init_data(message.Ptr, unsafe.Pointer(&data[0]), C.size_t(len(data)), nil, nil))
}
示例#2
0
文件: zmq.go 项目: miffa/gozero
func (p *lzmqMessage) SetData(coffer *MemCoffer) os.Error {
	data := unsafe.Pointer(coffer.GetBasePtr())
	return p.Provider().OkIf(C.zmq_msg_init_data((*C.zmq_msg_t)(p), data, C.size_t(coffer.Cap()), C.CloseMemCofferCb(), unsafe.Pointer(coffer)) == 0)
}