Sha256: 50f476a04603d5c648dab484acb63f395f1b23605b7fac632e4caf6b05a3d737
Contents?: true
Size: 1014 Bytes
Versions: 25
Compression:
Stored size: 1014 Bytes
Contents
#include "polyphony.h" VALUE Socket_send(VALUE self, VALUE msg, VALUE flags) { return Backend_send(BACKEND(), self, msg, flags); } VALUE Socket_write(int argc, VALUE *argv, VALUE self) { VALUE ary = rb_ary_new_from_values(argc, argv); VALUE result = Backend_sendv(BACKEND(), self, ary, INT2NUM(0)); RB_GC_GUARD(ary); return result; } VALUE Socket_double_chevron(VALUE self, VALUE msg) { Backend_send(BACKEND(), self, msg, INT2NUM(0)); return self; } void Init_SocketExtensions() { rb_require("socket"); VALUE cSocket = rb_const_get(rb_cObject, rb_intern("Socket")); VALUE cTCPSocket = rb_const_get(rb_cObject, rb_intern("TCPSocket")); rb_define_method(cSocket, "send", Socket_send, 2); rb_define_method(cTCPSocket, "send", Socket_send, 2); rb_define_method(cSocket, "write", Socket_write, -1); rb_define_method(cTCPSocket, "write", Socket_write, -1); rb_define_method(cSocket, "<<", Socket_double_chevron, 1); rb_define_method(cTCPSocket, "<<", Socket_double_chevron, 1); }
Version data entries
25 entries across 25 versions & 1 rubygems