URL
https://opencores.org/ocsvn/plasma/plasma/trunk
[/] [plasma/] [trunk/] [kernel/] [tcpip.c] - Diff between revs 353 and 361
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 353 |
Rev 361 |
Line 1292... |
Line 1292... |
OS_Thread_t *self;
|
OS_Thread_t *self;
|
|
|
if(socket->timeout)
|
if(socket->timeout)
|
socket->timeout = socket->timeoutReset;
|
socket->timeout = socket->timeoutReset;
|
|
|
|
#ifdef INCLUDE_FILESYS
|
|
if(socket->fileOut) //override stdout
|
|
return fwrite((char*)buf, 1, length, socket->fileOut);
|
|
#endif
|
|
|
//printf("IPWrite(0x%x, %d)", Socket, Length);
|
//printf("IPWrite(0x%x, %d)", Socket, Length);
|
self = OS_ThreadSelf();
|
self = OS_ThreadSelf();
|
while(length)
|
while(length)
|
{
|
{
|
//Rate limit output
|
//Rate limit output
|
Line 1370... |
Line 1375... |
uint32 IPRead(IPSocket *socket, uint8 *buf, uint32 length)
|
uint32 IPRead(IPSocket *socket, uint8 *buf, uint32 length)
|
{
|
{
|
IPFrame *frame, *frame2;
|
IPFrame *frame, *frame2;
|
int count=0, bytes, offset;
|
int count=0, bytes, offset;
|
|
|
|
#ifdef INCLUDE_FILESYS
|
|
if(socket->fileIn) //override stdin
|
|
{
|
|
bytes = fread(buf, 1, 1, socket->fileIn);
|
|
if(bytes == 0)
|
|
{
|
|
buf[0] = 0;
|
|
fclose(socket->fileIn);
|
|
socket->fileIn = NULL;
|
|
bytes = 1;
|
|
}
|
|
return bytes;
|
|
}
|
|
#endif
|
|
|
if(socket->state == IP_UDP)
|
if(socket->state == IP_UDP)
|
offset = UDP_DATA;
|
offset = UDP_DATA;
|
else
|
else
|
offset = TCP_DATA;
|
offset = TCP_DATA;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.