Fixed stream API usage in socket transport.