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

ONT-924 optimize transmit logic and the compatibility of dual/single port #391

Merged
merged 1 commit into from
Jun 23, 2018

Conversation

BooniesFX
Copy link

No description provided.

nCount := nByteCnt / common.PER_SEND_LEN
for i := 0; i < nCount; i++ {
conn.SetWriteDeadline(time.Now().Add(common.WRITE_DEADLINE * time.Second))
_, err = conn.Write(payload[i*common.PER_SEND_LEN : (i+1)*common.PER_SEND_LEN])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why need divided to n parts to call conn.Write instead one ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small package would be transmit more faster than write whole buffer under deadline and poor network environment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the exact opposite of what I think.

@laizy laizy merged commit baa8804 into ontio:master Jun 23, 2018
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.

None yet

2 participants