Kyle Ludwig

Problematic M52233DEMO TCP server with minisockets

Discussion created by Kyle Ludwig on Feb 1, 2007
Latest reply on Feb 7, 2007 by Mark Ashby
Hi there
 
I have been trying to create a TCP server for some time now with my M52233DEMO board. I am using InterNiche Lite's minisockets and Niche Task. I have tried to modify the HTTP server used in the example application (freescale_http_server) to be a simple TCP server listening on port 5005. When it receives data on this port it should then be outputted on the serial port (UART1). The changes I have made to the HTTP server include:
 
changing the port number
changing the http_init() function to exclude menu initialisation
changing the state machine (freescale_http_process() ) to exclude file uploads, and flash erasing and file sending)
modifying the read header function (freescale_http_read_header() ) to simply output any received data to the serial port.
 
My code for this task is attached
 
I can connect to the server and send data to it but herein lies my problem:
Connection works fine, but when I try to send data to the server, it takes at least 3 seconds for the server to receive and output this data (m_listen callback function is not called for received data) on the serial port. thereafter data is received and retransmitted quickly. The delay only happens for the first data load. The socket also doesn't close properly. (m_listen callback function is not called).
 
What could I be doing wrong? The HTTP server works correctly and is almost exactly the same.
 
Any help would be much appreciated
 
Thanks
Kyle
 
Message Edited by t.dowe on 2009-10-21 02:32 AM

Outcomes