00:01:20  * smorinquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:04:04  * smorinjoined
00:12:26  * smorin_joined
00:15:52  * smorinquit (Ping timeout: 240 seconds)
00:24:32  * tunniclm_quit (Ping timeout: 240 seconds)
00:25:59  * smorin_quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:36:41  * qardquit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:57:55  * smorinjoined
01:03:10  * tellnesquit (Ping timeout: 250 seconds)
01:05:32  * smorinquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:13:12  * smorinjoined
01:17:33  * smorinquit (Client Quit)
01:17:35  * zju_25joined
01:17:52  * zju3quit (Read error: Connection reset by peer)
01:17:52  * zju_xquit (Read error: Connection reset by peer)
01:18:43  * zju_xjoined
01:20:35  * tellnesjoined
01:32:58  * daurnimatorjoined
02:28:40  * brsonquit (Quit: leaving)
03:10:02  * addaleaxjoined
03:35:40  * bnoordhuisjoined
04:04:54  * avalanche123joined
04:22:21  * bnoordhuisquit (Quit: leaving)
04:27:32  * thefourtheyejoined
04:51:49  * rgrinbergquit (Ping timeout: 250 seconds)
06:21:42  * avalanche123quit (Remote host closed the connection)
06:22:08  * avalanche123joined
06:26:32  * avalanche123quit (Ping timeout: 240 seconds)
07:05:51  * saghul__quit (Quit: leaving)
07:38:57  * dokmajoined
07:40:01  <dokma>Can I uv_write to stream immediately after uv_accept? I want to show a prompt for incoming connection...
07:48:17  <dokma>isaacs: you around?
07:56:12  <txdv>there are examples
07:56:17  <txdv>in the tests directory
08:06:24  <dokma>txdv: there's a bunch of them, have an approximate idea in which one I might find it?
08:06:38  <dokma>I'm reading them atm
08:07:28  <dokma>reading test-tcp-write-after-connect.c
08:18:09  <txdv>you need to create a uv_tcp_t
08:18:11  <txdv>with init
08:18:13  <txdv>and accept on it
08:21:48  <dokma>txdv: I already have a connection that is working properly
08:21:59  <dokma>the client and server talk to eachother normally
08:22:18  <dokma>now I just want to write a prompt to the socket from server to client immediately upon the connection
08:22:44  <dokma>but can the server even write anything to the client without receiving something first?
08:24:22  * saghuljoined
08:27:59  <txdv>yes
08:28:01  <txdv>why not
08:28:03  <txdv>Oo
08:33:35  <dokma>txdv: because I'm getting a broken pipe from uv_write immediately after uv_read_start
08:33:45  <dokma>so I thought perhaps it's not even possible
08:59:51  * seishunjoined
09:12:49  * Guest26216quit (Ping timeout: 260 seconds)
10:10:16  * rendarjoined
10:18:07  <dokma>still can't get it resolved....
10:18:35  <dokma>is it possible to write something to the stream in the connection callback on the server side?
10:19:25  <txdv>yeap
10:22:33  <dokma>txdv: could you take a look at this and let me know if I've done some obvious nonsense in connection_cb? http://pastebin.com/hvLDusf1
10:23:29  <txdv>yeah
10:23:36  <txdv>tcp_client lives on the stack
10:23:53  <dokma>ohh...
10:23:56  <dokma>let me change that
10:24:31  * Jacob843quit (Remote host closed the connection)
10:24:36  <txdv>server too
10:25:56  * Jacob843joined
10:26:11  <dokma>fixed that... let me test
10:30:48  <dokma>txdv: I still get the same broken pipe
10:31:02  <dokma>let me paste the new code
10:32:12  <dokma>txdv: this is the updated code: http://pastebin.com/9btDHzm2
10:33:28  <dokma>when I remove lines 65 and 66 the servers works as expected...
10:33:54  <txdv>no wonder
10:34:00  <txdv>the request lives on the stack too
10:34:11  <txdv>and that shit aint flying with libuv
10:34:59  <dokma>fixed, let me test
10:35:31  <dokma>still broken pipe
10:35:51  <dokma>should prompt var be on the heap as well?
10:36:49  <txdv>afaik no
10:37:17  <dokma>txdv: so you think this should generally work?
10:37:46  <txdv>i dont know what 'this' is
10:38:21  <dokma>it's a small server with a scheme repl so you can telnet into it and execute scheme code
10:38:40  <dokma>when I remove lines 65&66 it works
10:38:55  <dokma>so I thought let's just add a prompt
10:39:17  <dokma>and my first inclination was: when the connection is established write the prompt to the stream
10:39:20  <dokma>but no go...
10:44:41  <txdv>upload the lastest thing that you got
10:44:48  <txdv>as a fistfile
10:44:51  <txdv>together with a makefile
10:46:44  <txdv>gistfile*
10:46:46  <txdv>you do know gist?
10:47:37  <dokma>latest with Makefile.am: http://pastebin.com/v6SXrz7U
10:47:45  <dokma>don't know about gist
10:47:50  <dokma>I can google it though
10:51:16  <dokma>gist on github?
10:51:40  * thealphanerdquit (Quit: farewell for now)
10:52:10  * thealphanerdjoined
10:52:38  <txdv>gist on github
10:59:10  * avalanche123joined
11:04:03  * avalanche123quit (Ping timeout: 264 seconds)
11:09:05  <txdv>dokma: uv_req_init is missing
11:09:41  <txdv>or maye not
11:12:02  <dokma>here are the gists:
11:12:04  <dokma>https://gist.github.com/evorion/3cd1790d6b1348b4700cff0c9dcc9b23
11:12:09  <dokma>https://gist.github.com/evorion/6e06845aa2a72562291c245a6e469bd7
11:12:20  <dokma>let me try with uv_req_init
11:13:31  <dokma>txdv: gists created
11:15:08  <dokma>apparently there is no uv_req_init iin libuv1 ?
11:34:55  <dokma>txdv: I've managed to trace where I get the broken pipe
11:34:58  <dokma>check this out
11:36:01  <dokma>http://pastebin.com/UQt8dFCy
11:36:33  <dokma>can you tell from the p *stream if the fd is valid?
11:47:34  <saghul>There is no uv_req_init required, that's internal to libuv
11:49:02  <txdv>dokma: yes, i was mistaken
12:01:47  <dokma>so everything seems to be right
12:01:54  <dokma>but I still get a broken pipe
12:02:30  <dokma>I've built libuv from source with debugging and stepped into uv_write2 and down to uv__write
12:02:41  <dokma>it fails on a call to write
12:02:45  <dokma>the data is valid
12:02:57  <dokma>so it has to be the socket that is dodgy
12:03:42  <dokma>apparently libuv does something else to the socket after the connection callback that makes it valid
12:05:21  <saghul>in your last gist you free buf->base after calling uv_write, that's incorrect
12:05:37  <saghul>you must wait until the write callback
12:05:57  <saghul>libuv won't copy the memory you want to write, only the buffer structure
12:07:05  <dokma>let me test without free
12:07:49  <dokma>still broken pipe
12:08:13  <dokma>saghul: do you also think that uv_write in the connection_cb is perfectly fine?
12:09:03  <saghul>yeah, it should be fine
12:10:19  <dokma>broken pipe happens here: https://github.com/libuv/libuv/blob/v1.x/src/unix/stream.c#L830
12:10:51  <dokma>I shall now dump the stream var when the broken pipe occurs and when it does not so we can compare
12:12:34  <saghul>halt
12:13:00  <saghul>you're calling uv_write on stream aka the server, not the client
12:13:08  <saghul>that's not going to fly, of course
12:13:21  <dokma>I was wondering that
12:13:26  <dokma>what's the problem?
12:14:20  <saghul>stream is the server, it listens for incoming connections, it doesn't represent the incoming connection
12:14:46  <saghul>if you want to write to the other side of the client which just connected to you have to write into "client" (in your code)
12:14:47  <dokma>oh...
12:21:54  <dokma>ofcourse now it works perfectly fine
12:22:05  <dokma>dangers of copy/pasting code without thinkg again...
12:22:19  <dokma>thank you saghul & txdv !!
12:33:47  * rgrinbergjoined
12:40:14  * Ruyi-HomePCjoined
14:35:08  * avalanche123joined
14:39:55  * avalanche123quit (Ping timeout: 252 seconds)
14:40:51  * dokmaquit (Ping timeout: 250 seconds)
14:47:03  * Fishrock123joined
14:54:57  * dokmajoined
14:59:34  * Ruyi-HomePCquit (Read error: Connection reset by peer)
15:35:57  * happy-dudejoined
15:40:41  * brsonjoined
16:31:33  * saghulquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
16:32:51  * seishunquit (Ping timeout: 264 seconds)
16:41:15  * Damn3dquit (Ping timeout: 264 seconds)
16:41:27  * seishunjoined
16:45:42  * Damn3djoined
16:56:55  * saghuljoined
17:44:33  * saghulquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
17:53:52  * Damn3dquit (Ping timeout: 264 seconds)
17:57:18  * Damn3djoined
18:11:41  * davijoined
18:21:06  * romankljoined
18:21:36  * rgrinbergquit (Quit: WeeChat 1.5)
18:22:15  * romanklquit (Max SendQ exceeded)
18:23:07  * romankljoined
18:30:02  * daviquit (Remote host closed the connection)
18:31:26  * rgrinbergjoined
18:34:58  * brsonquit (Ping timeout: 258 seconds)
18:49:45  * benjamingr_joined
19:09:13  * kenansulaymanjoined
19:09:37  * kenansulaymanchanged nick to Guest18855
19:16:24  * saghuljoined
19:28:33  * romanklquit (Quit: romankl)
19:29:12  * Guest18855quit (Ping timeout: 240 seconds)
19:34:05  * rgrinbergquit (Ping timeout: 250 seconds)
19:37:41  * addaleaxquit (Quit: ChatZilla 0.9.92 [Firefox 48.0/20160728203720])
19:38:53  * kenansulaymanjoined
19:39:23  * kenansulaymanchanged nick to Guest58774
19:45:00  * qardjoined
19:48:34  * addaleaxjoined
19:51:50  * seishunquit (Read error: Connection reset by peer)
19:53:50  * qardquit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:58:58  * saghulquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
19:59:17  * avalanche123joined
20:03:52  * avalanche123quit (Ping timeout: 244 seconds)
20:09:01  * saghuljoined
20:19:21  * rgrinbergjoined
20:23:05  * seishunjoined
20:36:32  * rendarquit (Ping timeout: 240 seconds)
20:37:31  * brsonjoined
21:06:46  * rendarjoined
21:20:34  * rgrinbergquit (Ping timeout: 258 seconds)
21:26:56  * tunniclm_joined
21:28:39  * rgrinbergjoined
21:30:22  * seishunquit (Quit: Leaving)
21:30:46  * seishunjoined
21:45:50  * seishunquit (Read error: Connection reset by peer)
21:47:16  * seishunjoined
21:56:14  * avalanche123joined
21:57:29  * saghulquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:58:48  * seishunquit (Read error: Connection reset by peer)
22:00:13  * seishunjoined
22:05:49  * rgrinbergquit (Ping timeout: 244 seconds)
22:21:30  * thefourtheyequit (Quit: Connection closed for inactivity)
22:27:27  * seishunquit (Ping timeout: 264 seconds)
22:31:07  * rendarquit (Quit: std::lower_bound + std::less_equal *works* with a vector without duplicates!)
23:25:01  * PerilousApricotjoined
23:38:47  * PerilousApricotquit (Remote host closed the connection)
23:39:00  * Fishrock123quit (Remote host closed the connection)
23:51:41  * Fishrock123joined
23:51:59  * Fishrock123quit (Remote host closed the connection)