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

Make TCP buffers configurable #333

Merged
merged 1 commit into from
Apr 2, 2020
Merged

Make TCP buffers configurable #333

merged 1 commit into from
Apr 2, 2020

Conversation

magiconair
Copy link
Member

This patch adds methods to configure the receive and transmit
buffers of the underlying TCP connection.

@magiconair
Copy link
Member Author

We ran into this today and hard-coded the changes. Need to see whether this approach works as well or whether we need to call SetReadBuffer/SetWriteBuffer after Dial but before the uacp handshake for this to work.

@kung-foo
Copy link
Member

I wonder if we should just promote the underlying conn:

type Conn struct {
        net.Conn
	id  uint32
	ack *Acknowledge
}

or if we can assume it is always TCP:

type Conn struct {
        net.TCPConn
	id  uint32
	ack *Acknowledge
}

@magiconair
Copy link
Member Author

net.Conn does not have the SetRead/WriteBuffer methods. We would have to type check twice.

Unless we support Websockets it will be TCP and even then.

@kung-foo
Copy link
Member

kung-foo commented Apr 1, 2020

Maybe this? 6f756f3

@magiconair
Copy link
Member Author

This looks good. Let me test that.

@kung-foo
Copy link
Member

kung-foo commented Apr 2, 2020

note: I didn't understand this bit right here: 6f756f3#diff-e06a25cad06b1ecd848e968ae7d9984eL293-R270

There's some bad naming, and aliasing going on. And I don't think there's anything that tests that path.

@magiconair
Copy link
Member Author

This is for the reverse handshake but we don't have any tests for that I think.

This patch adds methods to configure the receive and transmit
buffers of the underlying TCP connection.
@magiconair magiconair added this to the v0.1.11 milestone Apr 2, 2020
@magiconair magiconair merged commit 36b67bc into master Apr 2, 2020
@magiconair magiconair deleted the tcp-buffers branch April 2, 2020 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants