Fixed bugs related to adding a socket. Added socket cmdgw callback to Bind and Listen.