Petter Nordby

Running a TCP server with InterNiche stack in superloop mode

Discussion created by Petter Nordby on Apr 19, 2007
Latest reply on Feb 9, 2008 by Chuck Heller
I have posted some details in another thread here. Since then, I have been able to figure out some of the stuff by examining several versions of TCP servers in this forum.

My next problem might be related to functionality inside the stack:
  1. I sometimes get "calloc1 failed: size: 130, failures: 1" on disconnect after sending and receiving data.
  2. When disconnecting after having two simultaneous connections, the sw can lock up and stop responding to more TCP activity.
  3. Besides the totally missing documentation of msring functions (code is doc?), the mini socket functions could also clearly be better described. I wonder if m_ioctl() should be called on sockets returned from m_listen() or on the sockets returned from msring_del().
Does anyone have any experience with similar problems?

A few details which have changed or evolved since my previous thread posting:
  • Call tcp_tick() inside the timer_isr() function
  • Call pktdemux() from the superloop (e.g. somewhere in main())
  • Do not call inet_timer() or packet_check() in the timer_isr() function
  • I can successfully establish two simultaneous connections to the same port, and send/receive data correctly to each of them (verified with manually with netcat and "echo" functionality in my sw)
Does anyone else have details from a superloop tcp server?

Outcomes