Request Slice 1024bytes logs

why we making make([]byte, 1024) this big slice for request(1024 bytes).
Request is also 8 byte long right?
While I create 8 slices buf for the request(read) this give me error

Please tell me what I’m missing here
Please Tell me in details


Rishav

Hi,

I’m not sure about the error you are receiving when passing an 8-byte-long slice in connRead. What error are you getting?

I don’t know why we use 1024 other than it’s a convenient length that should allow you to read all the data received, if not, you can always read the remaining byte, since conn.Read will return the number of bytes read from the received data you can check if you’ve read it all or not.

1 Like

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.