JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.45k stars 5.46k forks source link

Calling UDPSocket functions in REPL causes error. #14552

Open abhijithanilkumar opened 8 years ago

abhijithanilkumar commented 8 years ago

It seems the following UDPSocket functions are broken.

julia> nb_available(s)
ERROR: type UDPSocket has no field buffer
 in nb_available at stream.jl:254

julia> isreadable(s);
ERROR: type UDPSocket has no field buffer
 in isreadable at stream.jl:243

julia> isopen(s);
ERROR: type UDPSocket has no field buffer
 in print at strings/io.jl:8
 in print_to_string at strings/io.jl:36
 in isopen at stream.jl:317
yuyichao commented 8 years ago

Didn't you fix this in https://github.com/JuliaLang/julia/pull/14325 ?

tkelman commented 8 years ago

That was where the errors were initially reported, but that PR only fixed show.

abhijithanilkumar commented 8 years ago

What message has to be displayed for these functions? @tkelman

tkelman commented 8 years ago

I'm having trouble finding the last discussion on this with @JeffBezanson and @vtjnash but the conclusion was that the hierarchy of IO types probably needs some rearranging given this type doesn't support the stream interface.

abhijithanilkumar commented 8 years ago

Is this the discussion?

kshyatt commented 8 years ago

I'm bumping this - @abhijithanilkumar and @tkelman, was that the discussion? Can we add these in? Is this still a problem?

tkelman commented 8 years ago

Happened in a few other places as well. There's some rearrangement of the IO type hierarchy that's still an outstanding TODO here, things are grouped in a funny way where some subtypes of the same abstract type don't implement the same interface at all. But I don't think this needs to happen before 0.5.

vtjnash commented 8 years ago

the main fix probably required here is that UDPSocket isn't really an IO (stream/file) type