System.Net.Socket.TSocketStream.Create

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

constructor Create(const ASocket: TSocket; AOwnsSocket: Boolean = True);

C++

__fastcall TSocketStream(TSocket* const ASocket, bool AOwnsSocket);

Properties

Type Visibility Source Unit Parent
constructor public
System.Net.Socket.pas
System.Net.Socket.hpp
System.Net.Socket TSocketStream

Description

Creates a socket stream from the specified socket.

By default, the created stream socket takes ownership of the specified socket. That is, when you destroy the stream socket, the stream socket destroys the underlying socket. If you do not want the stream socket to take ownership of the specified socket, make AOwnsSocket False.

Note: Stream sockets do not support UDP sockets.

Exceptions

A call to Create can raise any of the following exceptions:

Exception Exception.Message Scenarios

ESocketError

Socket type not compatible with call

See Also