ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
wontruefree has quit [Quit: bye]
<FromGitter> <jwoertink> What's the benefit for `File#write` to take `Bytes` instead of `String`?
<FromGitter> <jwoertink> or, I guess it's `IO#write`
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
<FromGitter> <faustinoaq> Wow, https://forum.nim-lang.org/t/3834 ❤️ ⏎ ⏎ I think we should try to experiment crystal->javascript as well 😉
<FromGitter> <girng> i liked the old design lol
txdv has quit [Ping timeout: 245 seconds]
<FromGitter> <faustinoaq> lol
<FromGitter> <forkev_twitter> +1 for old design. hmm.
<FromGitter> <girng> i really miss the crown and the epic horizontal navigation bar in top right lol
txdv has joined #crystal-lang
sherjilozair has joined #crystal-lang
<FromGitter> <S-YOU> Bytes does not have header, but String have 3 x Int32 header, imo.
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
<FromGitter> <jwoertink> What do you mean by "header"? Wouldn't writing a string or writing bytes to a file end in the same file size?
<FromGitter> <jwoertink> It just seems strange that this doesn't work
<FromGitter> <jwoertink> ```File.open("test.txt", "w") do |f| ⏎ f.write("testing\n") ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5b061a84b435f21fb8c19e3a]
<FromGitter> <jwoertink> but this does `File.write("test.txt", "testing\n")`
hightower2 has joined #crystal-lang
<FromGitter> <S-YOU> Well, String automatically does .to_unsafe, which extract data part only.
<FromGitter> <S-YOU> What I am talking about is this part. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b061c3aaaafa25932af9426]
<FromGitter> <jwoertink> Where does that bit of code come from?
<FromGitter> <S-YOU> string.cr
hightower3 has quit [Ping timeout: 240 seconds]
<FromGitter> <jwoertink> So what you're saying is writing a string to a file uses up more memory than writing bytes because of the additional header?
wontruefree has joined #crystal-lang
<FromGitter> <S-YOU> If you are building new string dynamically, may be. But If you are writing something already in memory, it should be same. ⏎ And you can always add new definitions for File#write for String argument.
<FromGitter> <jwoertink> I'm writing XML to some files. Would it be better to take the XML string, convert that to Bytes, then write the Bytes?
<FromGitter> <S-YOU> you can try .to_slice and writing the slice?
<FromGitter> <jwoertink> Ah, yeah, I could try that
<FromGitter> <jwoertink> Thanks for the explanation!
<FromGitter> <jwoertink> I'm still not super clear on it, but it at least opens it up a bit more.
<FromGitter> <bmulvihill> you can write the XML using the shovel operator `<<` which will internally call `write` I think
<FromGitter> <bmulvihill> and convert the bytes for you
<FromGitter> <jwoertink> Oh? I didn't know about that one. Right now I'm just using `File.write` since that lets me write a string directly.
<FromGitter> <bmulvihill> all IO have it
<FromGitter> <S-YOU> Yeah
<FromGitter> <bmulvihill> It will take any object, so you can pass a string
<FromGitter> <jwoertink> sweet
wontruefree has quit [Quit: bye]
<FromGitter> <jwoertink> Thanks for the help!
jsn- has quit [Ping timeout: 240 seconds]
jsn- has joined #crystal-lang
duane has joined #crystal-lang
<FromGitter> <jwoertink> Well, I'm not good at benchmarking, but it looks like `f << "testing\n"` is faster than `f.write("testing\n".to_slice)` or `File.write("test.txt", "testing\n")` in case anyone was interested
<FromGitter> <phoffer> How do I define/access a C constant in a library I’m linking? The docs have a page about constants under C bindings but it appears to be defining Crystal constants inside the lib
<FromGitter> <masukomi> i have a program that acts on piped input, but if there is no piped input it should just end. So far i have not found anyway to test if there's anything in ARGF that doesn't block if it's empty.... anyone know how to get around this?
<FromGitter> <bmulvihill> @jwoertink You can also use file.puts to automatically write the newline for you
wontruefree has joined #crystal-lang
krystal_ has quit [Ping timeout: 260 seconds]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
<FromGitter> <S-YOU> << is going through IO buffer, it make sense it is faster.
wontruefree has quit [Quit: bye]
sherjilozair has quit [Quit: Leaving...]
snsei has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
<FromGitter> <S-YOU> @masukomi, STDIN.tty? check might works for STDIN blocking thing.
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
intrepid has joined #crystal-lang
intrepid has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <codenoid> , how to do multiple check in one `has_key?`
<FromGitter> <codenoid> hi
<FromGitter> <bew> @phoffer what is a C constant? if it's a macro you must copy manually the value to Crystal, you say I want this macro, because the shared library doesn't have macro informations embedded
snsei has quit [Remote host closed the connection]
<FromGitter> <bew> you *can't say ...
<FromGitter> <bew> @codenoid do you have an example? I'd say just do multiple `has_key?`
snsei has joined #crystal-lang
<FromGitter> <codenoid> i wanted something like `has_key?(["key1", "key2"])`
<FromGitter> <codenoid> fit with array
<FromGitter> <bew> just do multiple call
<FromGitter> <codenoid> but my screen width doesn't fit with multiple has_key? definition
<FromGitter> <codenoid> no, okay, i will call has_key? twice
<FromGitter> <bew> and if you have an array of keys you need to check you can do `keys_array.any? { |key| some_hash.has_key? key }`
<FromGitter> <bew> or you can also use a tuple instead of `keys_array`
<FromGitter> <codenoid> ok ,
snsei has quit [Remote host closed the connection]
<FromGitter> <codenoid> tf, there is no error with `query.has_key?(["act", "user_id"])`
<FromGitter> <codenoid> but it's not what i wanted
<FromGitter> <bew> what is `query` ?
<FromGitter> <bew> its type
<FromGitter> <codenoid> hash
<FromGitter> <codenoid> ups
<FromGitter> <codenoid> yes hash
<FromGitter> <bew> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b0658279ed336150ea78989]
<FromGitter> <bew> I agree it's quite hard to debug...
<FromGitter> <bew> @asterite why not restrict the type of `has_key?`'s arg ?
<FromGitter> <bew> hmm actually that won't work with union types
<FromGitter> <bew> not sure
<FromGitter> <bew> nvm, it should work
<FromGitter> <bew> Oo `if (loc = location) && orig_loc = loc.original_location` => syntax error on the 2nd `=`
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
<FromGitter> <bew> at it works when I add `()` around the second assignement
<FromGitter> <bew> makes sense actually, but the error was weird at first
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon has quit [Quit: Leaving]
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #crystal-lang
salvor has quit [Ping timeout: 256 seconds]
tliff has quit [Ping timeout: 276 seconds]
asterite has quit [Ping timeout: 260 seconds]
jhass has quit [Ping timeout: 256 seconds]
DeBot has quit [Ping timeout: 256 seconds]
coderobe has quit [Ping timeout: 240 seconds]
literal has quit [Ping timeout: 276 seconds]
tilpner has quit [Ping timeout: 260 seconds]
coderobe has joined #crystal-lang
tilpner has joined #crystal-lang
salvor has joined #crystal-lang
Raimondi has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
<FromGitter> <bararchy> When other lang talk about List, is it an Array or more like a Hash? (or Set?)
<FromGitter> <bew> it depends on the language :P I'd say Array is the closest, but it could be a linked list
DeBot has joined #crystal-lang
<FromGitter> <ArtLinkov> In python list is an array, and dictionary is a hash
asterite has joined #crystal-lang
<FromGitter> <ArtLinkov> I think go has similar syntax
jhass has joined #crystal-lang
<FromGitter> <bararchy> @bew Linked-Lists are just something we don't really need when not in C right? ⏎ Basiclly `[pointer, data] => [pointer, data] => [pointer,data]`, which we can have Array of class in Crystal
yopp has joined #crystal-lang
literal has joined #crystal-lang
_whitelogger has joined #crystal-lang
<badeball> a linked list offers better performance for certain list-operations
<FromGitter> <bararchy> Wouldnt a simple Iterator with next be enough to have the same capabilties without losing performance because of Dynamic array?
<FromGitter> <yxhuvud> @bararchy there is a few places in stdlib where a linked list is used, but most of the time we don't need it. There are some cases when it is necessary to delete in the middle of lists where it makes sense to use them instead of arrays
<FromGitter> <bararchy> @yxhuvud Where is it used? sounds interesting
<FromGitter> <yxhuvud> it is not extracted to a separate class, but it is part of scheduler and Hash implementations.
<FromGitter> <yxhuvud> and potentially some other places
Nik736 has joined #crystal-lang
Nik736 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Nik736 has joined #crystal-lang
<wuehlmaus> anybody using the qt library of Papierkorb on a Mac [important prerequisite]. I am wondering because it would be my preferred library and i am getting fundamental require problems that i don't understand, shards install worked without error but crystal spec did not. Sadly Papierkorb is not there.
duane has joined #crystal-lang
shalmezad has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
duane has quit [Ping timeout: 252 seconds]
<FromGitter> <bararchy> wuehlmaus Do you have QT5 development libs and headers installed?
<wuehlmaus> i think i have, via brew
<wuehlmaus> i am using crystal support/generate_bindings.cr now
<wuehlmaus> it downloads really much now
<wuehlmaus> bararchy: do you use qt5 on a Mac?
<FromGitter> <bararchy> Nope, just trying to help :)
<wuehlmaus> i wanna do my home work, so it would be useful if someone said it worked on his/her Mac.
<wuehlmaus> Papierkorb wrote that he needed help on Mac.
<wuehlmaus> it's by far my best computer so i use that most of the time. I am a Linux user for decades but my Linux computer is not that good.
duane has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
<wuehlmaus> crystal support/generate_bindings.cr is downloading insanely many sources, more than 2 GB
<wuehlmaus> download_cache is now 9.5 GB!
<wuehlmaus> it's just to early to use on a Mac, it seems....
<wuehlmaus> Failed to configure Qt5.5 in /Users/wuehlmaus/p/crystal/qt5.cr/download_cache/qt-everywhere-opensource-src-5.5.0 - Abort
<FromGitter> <faustinoaq> <3
<FromGitter> <paulcsmith> I'm trying to add a feature to "did you mean" that required the location of the typenode. Hre's the spec: https://github.com/crystal-lang/crystal/blob/master/spec/compiler/semantic/did_you_mean_spec.cr The problem is the location filename is not ste when using assert_error. Does anyone know of a way to stub the filename for testing?
<crystal-gh> [crystal] asterite opened pull request #6127: Fix incorrect formatter of ending expression after heredoc (master...bug/6121-formatter-heredoc) https://git.io/vhIJX
ua has quit [Read error: Connection reset by peer]
ua has joined #crystal-lang
Nik736 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
That_Guy_Anon has joined #crystal-lang
duane has quit [Ping timeout: 276 seconds]
<crystal-gh> [crystal] asterite opened pull request #6128: Fix: detect error when trying to use unbound generic type in instance var (master...bug/5383-unbound-generic-type) https://git.io/vhI3p
Nik736 has joined #crystal-lang
Nik736 has quit [Client Quit]
Nik736 has joined #crystal-lang
wontruefree has joined #crystal-lang
Nik736 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <asterite> @paulcsmith you'll have to change assert_error to pass a filename and pass it along to other methods. In spec_helper there's an optional filename argument in some of the methods
wontruefree has quit [Quit: bye]
shalmezad has quit [Quit: This computer has gone to sleep]
rohitpaulk has joined #crystal-lang
shalmezad has joined #crystal-lang
wontruefree has joined #crystal-lang
Nik736 has joined #crystal-lang
<FromGitter> <jwoertink> When you have a method that uses `with Something.new yield`, in the block `self` doesn't refer to `Something`. Is there a way to get that context other than just passing it in the block?
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b06ebc3ee623e2e41fe6eef]
<crystal-gh> [crystal] asterite closed pull request #6127: Fix incorrect formatting of ending expression after heredoc (master...bug/6121-formatter-heredoc) https://git.io/vhIJX
<Yxhuvud> jwoerthink: `typeof(self)` could perhaps work?
<FromGitter> <bew> you can use `itself` which is a method that returns `self`
<FromGitter> <evandrojr> @Blacksmoke16 Many thanks! I just saw your answer for https://play.crystal-lang.org/#/r/42ei
<FromGitter> <Blacksmoke16> ah np :)
marrow16180 has joined #crystal-lang
<marrow16180> Hi
<FromGitter> <evandrojr> The trick was the .id in method_name.id
<RX14> @asterite why is this https://carc.in/#/r/44wp type inferred but this isn't: https://carc.in/#/r/44wm
That_Guy_Anon has quit [Remote host closed the connection]
<RX14> according to the latter error message (which was my understanding of the ivars type inference rules) that inferece would be impossible because we had to type Gen.new with it
<FromGitter> <jwoertink> nice! Thanks @bew :D `itself` is what I needed
<RX14> and i thought the whole point was not to type methods in the ivars pass
<FromGitter> <paulcsmith> @asterite Ok I'll take a look in spec_helper and see if I can cobble something together
<FromGitter> <asterite> RX14 type inference for instance vars work with class methods, but never with instance methods, and only if they have an explicit return type or if the type can be inferred from the body
<RX14> but what if the class method instantiates an instaqnce method?
<RX14> whats the point of having this rule then?
<FromGitter> <bew> RX14 looks like it doesn't work either https://carc.in/#/r/44ww
<RX14> this is dumb: https://carc.in/#/r/44wx
<RX14> just by renaming to foo it works: https://carc.in/#/r/44wy
wontruefree has quit [Quit: bye]
<FromGitter> <asterite> It's not hard to understand. The compiler won't deal with instance methods at that point
<FromGitter> <asterite> If you want an improvement, let's force typing instance vars, always, like any other language
<FromGitter> <asterite> That's consistent, easy to understand, fast to compute
<RX14> I thought that thats what we *did*
<FromGitter> <asterite> It seems like everyone is both enjoying type inference and hating it at the same time :-P
<RX14> those few small inference rules seemed to me automatic and basic
<RX14> not invoking the real typing algorithm at all
<RX14> just looking up literals and return type annotations
<FromGitter> <asterite> Right, it's never invoked
<RX14> if we don't invoke the real typing algorithm my question is how we type class method bodies?
<FromGitter> <bew> `type inference for instance vars work with class methods` what's the reason behind this?
rohitpaulk has quit [Ping timeout: 245 seconds]
<RX14> do they have a weird seperate different type inference algorithm?
<RX14> or is it just a specific part of the typing algorithm that deals with ivars we avoid
<FromGitter> <asterite> I mean, if you have Foo.new that infers to Foo
<RX14> but I can do Foo.foo
<RX14> where self.foo doesn't have a return type annotation
<RX14> and it's body contains a consitional
<FromGitter> <asterite> But what if someone over wrote that new? That's why this rule exists, it tries to see if the method exists and returns something else
<FromGitter> <asterite> Conditional is easy: union of both branches
<RX14> so the "type cannot be inferred" message isn't correct
<FromGitter> <asterite> Well, PRs are welcome if someone wants to remove all those things
<RX14> we can infer Type.method where Type.method doesn't have a return annotation
<RX14> i'd be interested to see how much it breaks...
<FromGitter> <asterite> Except we can if the body is a literal
<FromGitter> <asterite> Probably doesn't break any code. It was simple to implement so I did it
<RX14> ok
<RX14> well
<travis-ci> crystal-lang/crystal#7d136e4 (ci/32bits - [WIP] Compile 32 bits packages in ci): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/383290578
<RX14> i'm glad I understand a bit better now
<travis-ci> crystal-lang/crystal#bc04afd (master - Merge pull request #6127 from crystal-lang/bug/6121-formatter-heredoc): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/383289970
<DeBot> https://github.com/crystal-lang/crystal/pull/6127 (Fix incorrect formatting of ending expression after heredoc)
<FromGitter> <asterite> I should probably have sticked with simpler rules. Just literals and new. I don't know...
<RX14> perhaps
<RX14> if you're going to impose limits you might as well make them easy to understand
<RX14> if we get literal inference, exhaustiveness checks, user-defined annotations, and that type virtualization heuristic in for 0.25.0...
<RX14> thats going to be a killer release
<RX14> i mean it already is
<Yxhuvud> type virtualization? What did I miss?
<FromGitter> <bew> Yxhuvud: #6024
<DeBot> https://github.com/crystal-lang/crystal/pull/6024 (Don't automatically virtualize two types in the same hierarchy, unless one is deeper than the other)
<hmans> Release, I summon thee
<FromGitter> <Grabli66> Parallelism? :)
<FromGitter> <jwoertink> What's your go to method signature when doing optional arguments? Just using a Hash? or doing named arguments and just have a method with possibly 12 arguments?
<FromGitter> <bararchy> @jwoertink Well, it really depends on the usecase, usually when I find my self passing too many arg I just figureout if I can pass on an Object that has those vars inside
<FromGitter> <jwoertink> hmm... Like making a Struct just for additional options?
<FromGitter> <bararchy> yeha
<FromGitter> <jwoertink> that might not be a bad idea. I'm currently using NamedTuple and it's a nightmare so I need to refactor
<FromGitter> <bararchy> or, you sometime figure out that you just did something uneeded like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b06fe38d96cfd743eba9fd2]
<FromGitter> <jwoertink> I wanted something that looked like this `add("/about", changefreq: "yearly", priority: 0.1)`
<FromGitter> <jwoertink> but how I have that method defined, doing this fails
<FromGitter> <bew> how is it defined?
<FromGitter> <jwoertink> I guess I could do `def add(path : String, options : Options)` and make `Options` a struct
<FromGitter> <jwoertink> it's actually defined right now as `add(path : String, options : Options)`
<FromGitter> <bararchy> @jwoertink Not sure why but Crystal urges you to use long Hash and Tuples to store data and very quicly it becomes ⏎ ⏎ ```Tuple(a: String, b: Hash | String, c: What)``` ⏎ ⏎ My golden rule is this, take 5 min break, if you come back and see the Type and it looks like a huge monster, just make a class\struct [https://gitter.im/crystal-lang/crystal?at=5b06fec3752aff593110e0c1]
<FromGitter> <jwoertink> but Options is an alias to a NamedTuple
<FromGitter> <jwoertink> @bararchy that's a good point
<FromGitter> <bararchy> @girng Can also tell you about it happening to him :)
<FromGitter> <Grabli66> How to store any object in Hash? Want like Hash(String, AnyObject)
<FromGitter> <bew> @bararchy @jwoertink I just got a cool idea: https://carc.in/#/r/44xn
<FromGitter> <jwoertink> `alias AnyObject = String | Int32 | Bool | ....`
<FromGitter> <Grabli66> Ok. Thanks
<FromGitter> <jwoertink> oh nice! I think I like that better, @bew
<FromGitter> <jwoertink> That's the signature I was looking for. I have those defaults set anyway
wontruefree has joined #crystal-lang
<FromGitter> <bew> ;) glad it helped ;)
DTZUZU has quit [Ping timeout: 256 seconds]
DTZUZU has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <Grabli66> How to make @@counter global for all classes? https://play.crystal-lang.org/#/r/44xy
<oprypin> Grabli66, this works but it could fall apart when multiple files are involved https://play.crystal-lang.org/#/r/44y6
<oprypin> or maybe it won't fall apart. if it does, just remove `protected` and move on¯\_(ツ)_/¯
snsei has quit [Ping timeout: 260 seconds]
<FromGitter> <Grabli66> Thanks
That_Guy_Anon has joined #crystal-lang
duane has joined #crystal-lang
rGradeStd has joined #crystal-lang
rGradeStd has quit [Client Quit]
oprypin is now known as Guest11714
maxpowa is now known as Guest97416
robacarp is now known as Guest98178
Cyrus is now known as Guest49403
baweaver is now known as Guest3612
oz is now known as Guest23822
RX14 is now known as Guest38236
Vexatos has quit [Quit: ZNC Quit]
Vexatos has joined #crystal-lang
<FromGitter> <faustinoaq> https://cdn-images-1.medium.com/max/800/1*TPttZ5-4YcUetNoJ1xLxGg.jpeg
<FromGitter> <faustinoaq> lol
<FromGitter> <noahlh> language construct / type question for y'all:
<FromGitter> <noahlh> With a `foo` of type `(String | Nil)` if I run:
<FromGitter> <noahlh> `foo ? my_method(foo) : nil`
<FromGitter> <noahlh> my_method needs to handle `(String | Nil)` and compiler complains if not (which makes sense)
<FromGitter> <noahlh> But if I use
<FromGitter> <noahlh> `(bar = foo) ? my_method(bar) : nil`
<FromGitter> <noahlh> my_method doesn't need to handle the nil type. I think I understand why but I don't fully grok it. Can someone explain?
greenbigfrog has quit [Ping timeout: 255 seconds]
sz0 has joined #crystal-lang
marrow16180 has quit [Quit: Leaving]
greenbigfrog has joined #crystal-lang
<FromGitter> <bew> I bet `foo` is a method, right?
<FromGitter> <bew> @noahlh
<FromGitter> <noahlh> in the case where I discovered this it's an instance variable
<FromGitter> <noahlh> (which gets its value from a method)
<FromGitter> <bew> yeah it's the same logic but for a method it's simpler to understand: what if the method returned something else the second time you call it? the compiler can't be sure that the value returned by the method will be the same, and could be `nil`
<FromGitter> <bew> it's the same with instance variables, between the 2 access, the ivar could have changed (from another fiber for example)
<FromGitter> <bew> so the solution is to use a local variable to store the value locally, so that if the method/ivar changes, you'll still have the old value in the local var, that you can use
<FromGitter> <noahlh> GOT it. Perfect - thank you @bew
<FromGitter> <noahlh> I didn't realize the whole could-be-changed-by-a-fiber part - that's the piece I was missing. Concurrency! *shakes fist*
<FromGitter> <bew> you're welcome ;)
Guest49403 is now known as Cyrus
shalmezad has quit [Quit: Leaving]
Cyrus is now known as Guest9089
duane has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
That_Guy_Anon has quit [Quit: Leaving]
dragonkh has joined #crystal-lang
<travis-ci> crystal-lang/crystal#619ab12 (ci/32bits - [WIP] Compile 32 bits packages in ci): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/383413661
Nik736 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duane has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
wontruefree has quit [Quit: bye]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]