View previous topic :: View next topic |
Author |
Message |
miky_boy
Joined: 11 Jan 2008 Posts: 8
|
How to Send more than 1024 bytes using Socket |
Posted: Tue Jul 15, 2008 12:07 pm |
|
|
Hi to all.
I have to make my final high-school project and i work with acquisition in ADC and send this data using ENC28J60 by TCP Socket.
I have to send 6Kbytes in 1 second. So, the TCP buffer is 1024 bytes, i tried to enlarged, but it blocks.
So, i tried to make a tcp_flush when the buffer is full, but it can't send data again, i tried, MacFlush(), variables reset, but i can't send again data.
If anyone can help me or with any idea how to solve this i will be very appreciated.
Very thank's in advice.
Strong regards,
Miky |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Wed Jul 16, 2008 7:39 am |
|
|
The example web server (http.c) that comes with the TCP/IP stack from CCS is able to send large requests in multiple packets, so I'd have a look in there and see what it does. _________________ Andrew |
|
|
miky_boy
Joined: 11 Jan 2008 Posts: 8
|
|
Posted: Wed Jul 16, 2008 7:58 am |
|
|
Hi my friend, the http_parse_cgi_string is the method that you refer?!
I search in http.c and i can't understand how it sends in small packets :S:S
If you can help me.
Strong regards. |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Thu Jul 17, 2008 7:42 am |
|
|
From a quick look at the code, the socket handler looks like it calls TCPPut in a loop until TCPIsPutReady returns false. Then it saves where it is up to and exits. That allows the main TCP/IP stack to send the packet and get it acknowledged. Eventally the socket handler will be called again, whereupon it notices that it's still in the middle of a transfer and continues calling TCPPut until TCPIsPutReady returns false. That process continues until the transfer is complete. _________________ Andrew |
|
|
|