mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
try fix
This commit is contained in:
parent
ecf8cbcdda
commit
a6b33fe046
1 changed files with 2 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
|||
package tcp
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -129,12 +128,12 @@ func clientCommuncation(port string, c *comm.Comm) (err error) {
|
|||
// Read()s from the socket to the channel.
|
||||
func chanFromConn(conn net.Conn) chan []byte {
|
||||
c := make(chan []byte)
|
||||
reader := bufio.NewReader(conn)
|
||||
// reader := bufio.NewReader(conn)
|
||||
|
||||
go func() {
|
||||
for {
|
||||
b := make([]byte, models.TCP_BUFFER_SIZE)
|
||||
n, err := reader.Read(b)
|
||||
n, err := conn.Read(b)
|
||||
if n > 0 {
|
||||
// c <- b[:n]
|
||||
res := make([]byte, n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue