0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00
This commit is contained in:
Zack Scholl 2018-09-26 09:45:36 -07:00
parent ecf8cbcdda
commit a6b33fe046

View file

@ -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)