Hello,
We are using a LogicPD evoBoard with a OMAP-L138 (C6748-DSP). For the OMAP-software we use SysBios 6.30.3.46 and NDK 2.20.3.24. The OMAP-evoBoard is connected to another DSP-evoBoard over ethernet. The OMAP connects as TCP-client to the other DSP and receives during runtime a bigger amount of data.
With the code:
fdOpenSession((HANDLE)TaskSelf());
// configure Address and port:
struct sockaddr_in sin;
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = 0x021FA8C0;
sin.sin_port = htons(12002);
// create socket:
g_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
// connect to other DSP:
connect(g_socket, (PSA)&sin, sizeof(sin))
we open a connection to the other DSP and with:
while(receivedDataSize < 1)
{
receivedDataSize = recv(g_socket, buffer, sizeInByte, MSG_DONTWAIT);
}
we poll if their is some new data received.
The problem is that we work with polling to get the received data from the stack. Is their a way to work with callback functions so that the stack calls a function in our software if their is new received data in the stack?
Another item is that we have sometimes the problem that we do not receive all data in the OMAP, that was send by the other DSP. We solved this problem by increasing the NDK-receive-buffer with:
int test = 0x4000;
int testSize = sizeof(test);
int ret = setsockopt(g_socketBlackFin, SOL_SOCKET, SO_RCVBUF, &test, testSize);
But we are not sure if 0x4000 Bytes for the receive-buffer is big enough for our use.
Because of that we want to implement an error-handling for the case of lost data because of a too small receive-buffer. Is their a way to get the information from the stack if data is thrown because of an overloaded receive-buffer?
Thanks for any help,
Andreas