lib/0mq/socket.rb
# Send a string to the socket
Send a string to the socket
Send a string to the socket
def send_string(string, flags = 0)
      string = string.to_s
      size = string.respond_to?(:bytesize) ? string.bytesize : string.size
      @msgbuf = LibC.malloc size
      @msgbuf.write_string string, size
      rc = LibZMQ.zmq_msg_init_data @msgptr, @msgbuf, size, LibC::Free, nil
      ZMQ.error_check true if rc==-1
      rc = LibZMQ.zmq_sendmsg @pointer, @msgptr, flags
      ZMQ.error_check true if rc==-1
      rc = LibZMQ.zmq_msg_close @msgptr
      ZMQ.error_check true if rc==-1
    end
def send_string ( string , flags = 0 ) string = string . to_s size = string . respond_to? ( :bytesize ) ? string . bytesize : string . size @msgbuf = LibC . malloc size @msgbuf . write_string string , size rc = LibZMQ . zmq_msg_init_data @msgptr , @msgbuf , size , LibC :: Free , nil ZMQ . error_check true if rc == - 1 rc = LibZMQ . zmq_sendmsg @pointer , @msgptr , flags ZMQ . error_check true if rc == - 1 rc = LibZMQ . zmq_msg_close @msgptr ZMQ . error_check true if rc == - 1 end
Send a string to the socket
Send a string to the socket
string
<not_specific>
flags
<not_specific>