The size of the buffer used to receive data depends on the application or protocol. There is no way in the language to indicate how large your receive buffer should be. There is also no socket function that can be used that says, "you need 23867 bytes to receive this message." In general, your application should work out from the protocol what size should be the receive buffer and how to process it. Typically, the protocol will either:
- indicate the number of bytes in the message.
- (, hdlc, 0x7e, )
, . , , 2000 , 1000 , , , .