[go-nuts] channel synchronous, how to assure happens before ??

2020-01-06 Thread hao dong
After reading blog post : https://golang.org/ref/mem I got one question, in the code below: var c = make(chan int, 10) var a string func f() { a = "hello, world" c <- 0 } func main() { go f() <-c print(a) } How can the complier knows that a = "hello,

Re: [go-nuts] channel synchronous, how to assure happens before ??

2020-01-06 Thread hao dong
thanks for your reply. Could you guide me any readings or source code about channel of happens before. On Tuesday, January 7, 2020 at 3:02:30 AM UTC+8, Ian Lance Taylor wrote: > > On Mon, Jan 6, 2020 at 10:55 AM hao dong > > wrote: > > > > After reading blog post : ht

Re: [go-nuts] channel synchronous, how to assure happens before ??

2020-01-06 Thread hao dong
On Mon, Jan 6, 2020 at 5:47 PM hao dong > > wrote: > >> thanks for your reply. Could you guide me any readings or source code >> about channel of happens before. >> > > I think you have misunderstood this text in the https://golang.org/ref/mem > document you linke

[go-nuts] Re: Is there a way to limit number or requests on a KeepAlive connection on net/http server?

2020-01-15 Thread hao dong
I don't think you can limit the number of requests by the *MaxRequestsPerConn* of fasthttp, because the Conn in this func is new struct created by fasthttp which stores in pool. Real client connections will be send to channels which be processed by these Conns. For @ Tamás , Server.ConnState ap

[go-nuts] Re: Reusing tcp connections on tunnels

2020-01-16 Thread hao dong
I don't think every net.Dial() creates an actually tcp connection to a server, this func is just an abstract of system call. Desingers of Go are so clever that will not do this stupid thing. I think I will make a test of that. On Friday, January 17, 2020 at 4:07:28 AM UTC+8, XXX ZZZ wrote: > >

[go-nuts] where is temp file created by http server

2020-07-16 Thread hao dong
As I have learned, http server will store user-upload file on disk when its size exceed 32MB. I read the source code, and find out the large file to store in os.TempDir(), however, after uploading a large file, I can not find the file in the temp dir. Cloud someone enlight me, where is the temp

Re: [go-nuts] where is temp file created by http server

2020-07-16 Thread hao dong
lly by the FormFile method on *http.Request or to create a multipart > reader and break it out yourself. > > The reason the latter is interesting is because it can avoid storing data > you are not prepared to handle. > > On Thu, Jul 16, 2020 at 12:44 PM hao dong > > wrote: >

Re: [go-nuts] where is temp file created by http server

2020-07-16 Thread hao dong
art files in temp. Debugging async code and > judicious use of RemoveAll can help with this. > > https://golang.org/pkg/mime/multipart/#Form.RemoveAll > > > > On Thu, Jul 16, 2020 at 5:59 PM hao dong > > wrote: > >> thx. Can you help me find the link or doc which

Re: [go-nuts] where is temp file created by http server

2020-07-19 Thread hao dong
thx. I'll check it. On Saturday, July 18, 2020 at 12:03:52 AM UTC+8, Jake Montgomery wrote: > > On Thursday, July 16, 2020 at 10:32:32 PM UTC-4, hao dong wrote: >> >> thanks. I've noticed the code,too. And that's what I'm confused: when >> there is