Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/playground/socket: large writes split into multiple messages #13749

Closed
neelvirdy opened this issue Dec 28, 2015 · 2 comments
Closed

x/tools/playground/socket: large writes split into multiple messages #13749

neelvirdy opened this issue Dec 28, 2015 · 2 comments

Comments

@neelvirdy
Copy link

Context: http://127.0.0.1:3999/methods/16

Running my gotour pic tutorial for an image of size 256x256, sometimes pic.ShowImage doesn't actually show the full image. It'll show an image of a smaller size (about 256x160) and print the rest of the data as an ASCII parsed string. Other times it shows the full 256x256 image.

Code below:

package main

import (
"golang.org/x/tour/pic"
"image"
"image/color"
)

type Image struct {
W, H int
}

func (i Image) ColorModel() color.Model {
return color.RGBAModel
}

func (i Image) Bounds() image.Rectangle {
return image.Rect(0, 0, i.W, i.H)
}

func (i Image) At(x, y int) color.Color {
return color.RGBA{uint8(x^y), uint8(x*y), uint8((x+y)/2), 255}
}

func main() {
m := Image{256, 256}
pic.ShowImage(m)
}

@bradfitz bradfitz added this to the Unreleased milestone Jan 21, 2016
@adg adg changed the title tour: non-deterministic result from ShowImage x/tools/playground/socket: large writes split into multiple messages Jan 21, 2016
@adg
Copy link
Contributor

adg commented Jan 21, 2016

The issue is that the backend is sometimes splitting the image data into two separate messages. The browser only sees the first one as an image. The backend should be smarter about splitting messages.

@gopherbot
Copy link

CL https://golang.org/cl/19942 mentions this issue.

@golang golang locked and limited conversation to collaborators Feb 28, 2017
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants