Controlling nginx
socket){:ok,pid}=Task.Supervisor.start_child(KVServer.TaskSupervisor,fn->serve(client)end):ok=:gen_tcp.controlling_process
controlling_process(Socket,Pid)->ok|{error,Reason} 类型 分配一个新的控制过程Pid来Socket。控制过程是从套接字接收消息的过程。
与gen_udp:controlling_process/2。相同。 eof(Socket,Assoc)->ok|{错误,原因} 类型 正常结束所指定的关联Assoc,并清除所有未发送的数据。
返回的传输套接字将设置以下选项:[{active,false},{packet,0},{mode,binary}] controlling_process(SslSocket,NewOwner)->ok
看gen_tcp:controlling_process/2。 如果使用的操作系统不支持sendfile,则使用read/2和gen_tcp:send/2使用的Erlang回退。