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++ {
>
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 {
> continue
> }
> handleClient(co
Sorry, the last program is about server.and the following program is about
the client:
package main
import (
"fmt"
"net"
"os"
)
func main() {
var buf [512]byte
if len(os.Args) != 2 {
fmt.Fprintf(os.Stderr, "usage:%s host:port", os.Args[0])
}
service := os.Args[1]
tcpAddr, err :
who can solve this problem?
在 2017年10月30日星期一 UTC+8下午2:55:27,28911...@gmail.com写道:
>
> I write this code in the follwings:
> package main
>
> import (
> "fmt"
> "net"
> "os"
> )
>
> func main() {
> service := ":5000"
> tcpAddr, err := net.ResolveTCPAddr("tcp", service)
> checkError(err)
> listener,
10 matches
Mail list logo