Skip to content

UDP Write() will not send 0 byte datagram #274

@gopherbot

Description

@gopherbot

by jonathan.r.hudson:

What steps will reproduce the problem?
1. Create a UDP socket
2. send a 0 byte datagram

var b [1]byte;
conn,err := net.DialUDP("udp", nil, raddr);
...
conn.Write(b[0:0]);
/*  conn.WriteToUDP(b[0:0],raddr); // This works */

What is the expected output? What do you see instead?

It is expected that a 0 byte datagram is sent.
The 0 byte datagram is not sent. note: WriteToUDP works posixally correctly 
(in this case a 0 byte datagram is sent).

What is your $GOOS?  $GOARCH?

linux, amd64

Which revision are you sync'ed to?  (hg log -l 1)

changeset:   4150:cb559bd8a773
tag:         tip
user:        Robert Griesemer <gri@golang.org>
date:        Thu Nov 19 00:04:30 2009 -0800
summary:     bug219: parsing difficulties with 6g


Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions