CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to Send more than 1024 bytes using Socket

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
miky_boy



Joined: 11 Jan 2008
Posts: 8

View user's profile Send private message

How to Send more than 1024 bytes using Socket
PostPosted: Tue Jul 15, 2008 12:07 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Wed Jul 16, 2008 7:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 16, 2008 7:58 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Thu Jul 17, 2008 7:42 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group