net/http的handle中启动goruntime
{ http.HandleFunc("/device_status", radiusAccountHandler) err := http.ListenAndServe(":8000", nil) } func radiusAccountHandler(w http.ResponseWriter, r *http.Request) { // 处理请求 fmt.Fprintf(w, "ok") go sendAccountToInst(r) }
实际上 执行sendAccountToInst函数时, 传入的参数r 值都为空。此时将go sendAccountToInst(r)改为 sendAccountToInst(r)就正常
什么原因?
目前查看net/http的源代码:
inFlightResponse = w serverHandler{c.server}.ServeHTTP(w, w.req) // 回调注册的函数 inFlightResponse = nil w.cancelCtx()// 所有的子上下文被取消
    http代理服务器(3-4-7层代理)-网络事件库公共组件、内核kernel驱动 摄像头驱动 tcpip网络协议栈、netfilter、bridge 好像看过!!!!
但行好事 莫问前程
--身高体重180的胖子
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号