fix test servers

pull/168/head
v2ray 9 years ago
parent 7cb784b678
commit 406360ed3e

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

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

Loading…
Cancel
Save