getqujing / qtunnel

A secure socket tunnel works on getqujing.com
Other
1.66k stars 324 forks source link

Why do we need to close connection after each transport? #8

Closed yunxing closed 9 years ago

yunxing commented 9 years ago

Hey, noob question here: It looks like everytime we read/write something from/to a connection, we close it. Shouldn't it be more efficient if we keep the connection alive?

yunxing commented 9 years ago

As discussed in the other thread, io.copy indeed copies data until EOF is reached. I didn't notice that but was thinking it just copy data once... Sorry for the confusion.