Using Multiple Sockets
Mike G
Posts: 2,702
After considerable time and frustration I finally have multiple socket coordination. http://www.agaverobotics.com/spinneret/source/
Nothing fancy just the ability to handle up to 4 socket requests. I welcome any respectful comments and I will do my best to fix any bugs. I'm sure there are bugs. In a nutshell, I created a status register state machine and a FIFO buffer to hold socket IDs.
Secondly, I took some liberties in changing the Indirect Driver code.
There was a point yesterday where I considered giving up. I keep at it and learned a lot in the process.
Nothing fancy just the ability to handle up to 4 socket requests. I welcome any respectful comments and I will do my best to fix any bugs. I'm sure there are bugs. In a nutshell, I created a status register state machine and a FIFO buffer to hold socket IDs.
Secondly, I took some liberties in changing the Indirect Driver code.
There was a point yesterday where I considered giving up. I keep at it and learned a lot in the process.
Comments
-Phil
If anyone has guidance to share, I'm all ears man... I've spent a lot of hours on this project.
-Phil
I cleaned up a few logic blocks and added more debugging output. This is what happens...
I can load the index.htm page 12 times in a row. The 13th time always locks the server. When I look at the request object (memory) , the expected alignment is off by several bytes.
I can load the ajax.htm page 10 times. The 11th times locks the server like index.htm. At least I can reproduce the issue.
A very noticeable time delay along with statuses 0x18 and 0x00 start popping up a few clicks before a crash.
At this point, I'm not sure if the issue is with my server code, the indirect driver itself, or my modifications to the indirect driver.
Latest code
I thought that Request[4] would carve out memory for each of the 4 object DAT blocks. I just ran a little test this morning and it looks like DAT sections of the indexed objects all have the same memory address. I did not expect that. I'll do a little more testing and reading to make sure that my new observation is correct.
I'm actually surprised that the code worked for 61 requests before blowing up.
The error did not show itself until a fix number of iterations down a specific path. I realized early that the error was not random but I could not figure out the source. After writing several debug templates I realized the error was dependent on one variable. It took me 6 days of troubleshooting for a two line fix. I fixed a lot of other stuff a long the way... I think.
I'll leave the Spinneret up for a while.
http://spinneret.servebeer.com:5000/index.htm
I ordered a second Spinneret today so I can leave one server online and still develop.
Anyway, I hit the spinneret index.htm with 40,000 requests and 5 concurrent users using Apache Bench.
No locks or squawks. However, I have been able to cause a stuck 0x1C status holding down ctrl-F5 (refresh) in Firefox. Like I said, I have to fix that.
Web site using TCP
http://spinneret.servebeer.com:5000/
UDP testing site. You can use this to test your UDP site too, just change the default IP and port.
http://www.agaverobotics.com/spinneret/udptest.aspx
Source is in the same spot
http://www.agaverobotics.com/spinneret/source/
I'll leave it up for a while.