1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

fix test servers

This commit is contained in:
v2ray 2016-05-02 23:02:40 +02:00
parent 7cb784b678
commit 406360ed3e
2 changed files with 1 additions and 3 deletions

View File

@ -32,7 +32,6 @@ func (server *Server) Start() (v2net.Destination, error) {
func (server *Server) acceptConnections(listener *net.TCPListener) { func (server *Server) acceptConnections(listener *net.TCPListener) {
server.accepting = true server.accepting = true
defer listener.Close()
for server.accepting { for server.accepting {
conn, err := listener.Accept() conn, err := listener.Accept()
if err != nil { if err != nil {

View File

@ -31,8 +31,7 @@ func (server *Server) Start() (v2net.Destination, error) {
func (server *Server) handleConnection(conn *net.UDPConn) { func (server *Server) handleConnection(conn *net.UDPConn) {
server.accepting = true server.accepting = true
defer conn.Close() for server.accepting {
for {
buffer := make([]byte, 2*1024) buffer := make([]byte, 2*1024)
nBytes, addr, err := conn.ReadFromUDP(buffer) nBytes, addr, err := conn.ReadFromUDP(buffer)
if err != nil { if err != nil {