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
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
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
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
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
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
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++ {
>