Pork tapeworms are only 1/4 inch long when fully grown and live in the head area. I think you have the canine variety of tapeworm.
Tapeworms are flat and are made up of "segments". Each of these segments have both male and female parts. The parts mate - the segment fills up with eggs - and the segment (which now is hard and rounder) falls off of the tapeworm.
The longer corn looking thing you passed was simply a few egg filled segments that were "stuck together" when they broke away from the tapeworm.
The toxins from hosting parasites are causing your leg problems too.