Implement tcp connect primitive