Project

General

Profile

Feature #936

IO.nread function

Added by OlegPuchinin (Oleg Puchinin) almost 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:20917]

Description

=begin
USAGE:
require 'socket'
s1 = UDPSocket.new
s1.bind("127.0.0.1", 0)
s2 = UDPSocket.new
s2.bind("127.0.0.1", 0)

  s2.connect(*s1.addr.values_at(3,1))
  s1.connect(*s2.addr.values_at(3,1))
  s1.send "aasdfsadfwasdfasdaa", 0     
  IO.select([s2]) # emulate blocking recvfrom

  # !!!!!!!!!!!!!!!!
  p s2.recvfrom_nonblock(s2.nread)  #=> ["aaa", ["AF_INET", 33302, "localhost.localdomain", "127.0.0.1"]]
  # !!!!!!!!!!!!!!!!

=end


Files

nread.diff (717 Bytes) nread.diff OlegPuchinin (Oleg Puchinin), 12/27/2008 08:30 PM

Associated revisions

Revision 21162
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be
    1. suggested by akr in [ruby-core:20918]. response to feature request #936 in [ruby-core:20917].

Revision 21162
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be
    1. suggested by akr in [ruby-core:20918]. response to feature request #936 in [ruby-core:20917].

Revision 21162
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be
    1. suggested by akr in [ruby-core:20918]. response to feature request #936 in [ruby-core:20917].

Revision 21162
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be
    1. suggested by akr in [ruby-core:20918]. response to feature request #936 in [ruby-core:20917].

Revision 21162
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be
    1. suggested by akr in [ruby-core:20918]. response to feature request #936 in [ruby-core:20917].

Revision 21162
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be
    1. suggested by akr in [ruby-core:20918]. response to feature request #936 in [ruby-core:20917].

Revision 21169
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/io/wait/wait.c (io_nread): returns number of bytes available for read. response to feature request #936 in [ruby-core:20917].

Revision 21169
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/io/wait/wait.c (io_nread): returns number of bytes available for read. response to feature request #936 in [ruby-core:20917].

Revision 21169
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/io/wait/wait.c (io_nread): returns number of bytes available for read. response to feature request #936 in [ruby-core:20917].

Revision 21169
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/io/wait/wait.c (io_nread): returns number of bytes available for read. response to feature request #936 in [ruby-core:20917].

Revision 21169
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/io/wait/wait.c (io_nread): returns number of bytes available for read. response to feature request #936 in [ruby-core:20917].

Revision 21169
Added by matz (Yukihiro Matsumoto) almost 11 years ago

  • ext/io/wait/wait.c (io_nread): returns number of bytes available for read. response to feature request #936 in [ruby-core:20917].

History

#1

Updated by matz (Yukihiro Matsumoto) almost 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r21162.
=end

#2

Updated by OlegPuchinin (Oleg Puchinin) almost 11 years ago

=begin
nread can be used in TCP sockets :D
=end

Also available in: Atom PDF