Added socket processing to HTTPSession class