LT's recent timeline updates
LT

LT

V2EX member #80489, joined on 2014-11-07 09:38:31 +08:00
服务器被黑好蛋疼 ...记录下 随便求助
程序员  •  LT  •  Jul 18, 2016  •  Lastly replied by asp
39
服务器被黑。。。想找发出数据的进程
问与答  •  LT  •  Jul 17, 2016  •  Lastly replied by Syc
7
所谓的防蓝光眼镜有用么?
问与答  •  LT  •  Mar 13, 2015  •  Lastly replied by LT
14
LT's recent replies
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
没有阻塞额。。。直接在 go func 外层定义变量, 里层接收值就可以了,
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
@dishonest 看这个 issue 解释 kataras/iris/issues/463 然后,测试下 上一条回复的代码
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
func test(ctx context.Context) {
c := make(chan int)
fmt.Println("start")
go func(){
// 等待 10 秒
time.Sleep(time.Duration(5) * time.Second)
c <- 0
}()
<- c
fmt.Println("end")
ctx.Text("test")
}
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
```
func test(ctx context.Context) {
go func(){
fmt.Println("start")

// 等待 10 秒
time.Sleep(time.Duration(10) * time.Second)

fmt.Println("end")

ctx.Text("test")
}()
}

```
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
time.sleep 是主线程休眠,你要模拟延迟响应应该写盗 go func(){}里面
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
其实我更好奇你写出的阻塞代码。每个 http 请求本来就是独立的啊
Jul 18, 2016
Replied to a topic by LT 程序员 服务器被黑好蛋疼 ...记录下 随便求助
添加一些 ip 到防火墙后, iptables 的规则里面没有相应 ip, iptables -L 的结果是:
DROP all -- bzq-79-178-9-254.red.bezeqint.net anywhere
DROP all -- cable-24-135-138-230.dynamic.sbb.rs anywhere
DROP all -- 105-226-148-3.east.dsl.telkomsa.net anywhere
DROP all -- host-41.238.20.42.tedata.net anywhere
DROP all -- 188.228.36.184.dynamic.altibox.net anywhere
DROP all -- 91.204.60.100.cn.zp.ua anywhere

这些都是动态 vps 吧?
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2505 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms · UTC 03:13 · PVG 11:13 · LAX 20:13 · JFK 23:13
♥ Do have faith in what you're doing.