Re: [go-nuts] Re: network programming about go

2017-12-01 Thread as
TCP doesn't preserve message delimiters. There is no guarantee that one write will be one read on the remote side even if they appear to be reading and writing in lockstep. On Monday, November 13, 2017 at 1:57:33 PM UTC-8, Justin Israel wrote: > > > > On Mon, Nov 13, 2017 at 4:00 PM <28911...@g

Re: [go-nuts] Re: network programming about go

2017-11-13 Thread Justin Israel
On Mon, Nov 13, 2017 at 4:00 PM <2891132l...@gmail.com> wrote: > I know your meaning.But I still can't get the result I want. > this is the server program: > package main > > import ( > "fmt" > "net" > "os" > "strings" > ) > > func main() { > > listener, err := net.Listen("tcp", "0.0.0.0:400") > c

Re: [go-nuts] Re: network programming about go

2017-11-12 Thread 2891132love
I know your meaning.But I still can't get the result I want. this is the server program: package main import ( "fmt" "net" "os" "strings" ) func main() { listener, err := net.Listen("tcp", "0.0.0.0:400") checkError(err) for i := 0; i < 10; i++ { conn, err := listener.Accept() if err != nil { co

Re: [go-nuts] Re: network programming about go

2017-11-12 Thread Justin Israel
On Sun, Nov 12, 2017, 10:11 PM <2891132l...@gmail.com> wrote: > So how to modify my program correctly??I try to add read in different > place but it still can't get the result I want. > Make sure your server is doing: read, write, read, write And your client is doing: write, read, write, read

Re: [go-nuts] Re: network programming about go

2017-11-12 Thread 2891132love
So how to modify my program correctly??I try to add read in different place but it still can't get the result I want. 在 2017年11月12日星期日 UTC+8上午5:05:49,Justin Israel写道: > > > > On Sun, Nov 12, 2017, 10:03 AM Justin Israel > wrote: > >> >> >> On Sat, Nov 11, 2017, 9:55 PM <28911...@gmail.com > wrot

Re: [go-nuts] Re: network programming about go

2017-11-11 Thread Justin Israel
On Sun, Nov 12, 2017, 10:03 AM Justin Israel wrote: > > > On Sat, Nov 11, 2017, 9:55 PM <2891132l...@gmail.com> wrote: > >> this is the server program: >> >>> package main >>> >>> import ( >>> "fmt" >>> "net" >>> "os" >>> >> "strings" >>> ) >>> >>> func main() { >>> >>> listener, err := net.List

Re: [go-nuts] Re: network programming about go

2017-11-11 Thread Justin Israel
On Sat, Nov 11, 2017, 9:55 PM <2891132l...@gmail.com> wrote: > this is the server program: > >> package main >> >> import ( >> "fmt" >> "net" >> "os" >> > "strings" >> ) >> >> func main() { >> >> listener, err := net.Listen("tcp", "0.0.0.0:400") >> > checkError(err) >> for i := 0; i < 10; i++ { >