发送数据的时候,超过1500个字节数据丢失? void client_send(uint8 *pdata_buf, uint16 size)
{
struct pbuf *p_tx;
if (ConnectState == NET_UNLINK)
return;
if (ptcp_client == NULL)
return;
if ((pdata_buf != NULL) && (size > 0)) {
p_tx = pbuf_alloc(PBUF_TRANSPORT, size , PBUF_POOL);
if (p_tx != NULL) {
/* copy data to pbuf */
pbuf_take(p_tx, (char*)pdata_buf, size);
if (ptcp_client->p_tx == NULL)
ptcp_client->p_tx = p_tx;
else
pbuf_cat(ptcp_client->p_tx, p_tx);
tcp_client_send(pClientPcb, ptcp_client);
}
}
} |