Instance Method

streamTaskWithHostName:port:

Creates a task that establishes a bidirectional TCP/IP connection to a specified hostname and port.

Declaration

- (NSURLSessionStreamTask *)streamTaskWithHostName:(NSString *)hostname port:(NSInteger)port;

Parameters

hostname

The hostname of the connection endpoint.

port

The port of the connection endpoint.

Return Value

The new session stream task.

Discussion

After you create the task, you must start it by calling its resume method.

See Also

Adding Stream Tasks to a Session

- streamTaskWithNetService:

Creates a task that establishes a bidirectional TCP/IP connection using a specified network service.

NSURLSessionStreamTask

A URL session task that is stream-based.

NSURLSessionStreamDelegate

A protocol that defines methods that URL session instances call on their delegates to handle task-level events specific to stream tasks.