lib/corosync/cpg.rb
# Send one or more messages to the group.
# Sending multiple messages through a single call to {#send} ensures that the messages will be delivered consecutively without another message in the middle.
# @param messages [Array<String>,String] The message(s) to send.
# @return [void]
Send one or more messages to the group.
Sending multiple messages through a single call to {#send} ensures that the messages will be delivered consecutively without another message in the middle.
Send one or more messages to the group . Sending multiple messages through a single call to { #send } ensures that the messages will be delivered consecutively without another message in the middle .
def send(messages)
		messages = [messages] if !messages.is_a?(Array)
		iovec_list_p = FFI::MemoryPointer.new(Corosync::Iovec, messages.size)
		iovec_list = messages.size.times.collect do |i|
			iovec = Corosync::Iovec.new(iovec_list_p + i * Corosync::Iovec.size)
			message = messages[i].to_s
			iovec[:iov_base] = FFI::MemoryPointer.from_string(message)
			iovec[:iov_len] = message.size
			iovec
		end
		iovec_len = messages.size
		Corosync.cs_send(:cpg_mcast_joined, @handle, Corosync::CPG_TYPE_AGREED, iovec_list_p, iovec_len)
		true
	end
def send ( messages ) messages = [ messages ] if ! messages . is_a? ( Array ) iovec_list_p = FFI :: MemoryPointer . new ( Corosync :: Iovec , messages . size ) iovec_list = messages . size . times . collect do | i | iovec = Corosync :: Iovec . new ( iovec_list_p + i * Corosync :: Iovec . size ) message = messages [ i ] . to_s iovec [ :iov_base ] = FFI :: MemoryPointer . from_string ( message ) iovec [ :iov_len ] = message . size iovec end iovec_len = messages . size Corosync . cs_send ( :cpg_mcast_joined , @handle , Corosync :: CPG_TYPE_AGREED , iovec_list_p , iovec_len ) true end
Send one or more messages to the group.
Send one or more messages to the group .
None
void
messages
The message(s) to send.
The message ( s ) to send .