mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
use netconn
This commit is contained in:
parent
fecc8d5897
commit
928b28dc80
1 changed files with 1 additions and 0 deletions
|
@ -41,6 +41,7 @@ func (c *Comm) Close() {
|
||||||
|
|
||||||
func (c *Comm) Write(b []byte) (int, error) {
|
func (c *Comm) Write(b []byte) (int, error) {
|
||||||
c.writer.Write([]byte(fmt.Sprintf("%0.6d", len(b))))
|
c.writer.Write([]byte(fmt.Sprintf("%0.6d", len(b))))
|
||||||
|
c.writer.Flush()
|
||||||
n, err := c.writer.Write(b)
|
n, err := c.writer.Write(b)
|
||||||
if n != len(b) {
|
if n != len(b) {
|
||||||
err = fmt.Errorf("wanted to write %d but wrote %d", n, len(b))
|
err = fmt.Errorf("wanted to write %d but wrote %d", n, len(b))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue