System.Net.Socket.TSocket.Create
Delphi
constructor Create(ASocket: TSocketHandle; const AAddr: sockaddr_in; const AEncoding: TEncoding); overload;
constructor Create(ASockType: TSocketType; const AEncoding: TEncoding = nil); overload;
C++
__fastcall TSocket(NativeUInt ASocket, const sockaddr_in &AAddr, System::Sysutils::TEncoding* const AEncoding)/* overload */;
__fastcall TSocket(TSocketType ASockType, System::Sysutils::TEncoding* const AEncoding)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | System.Net.Socket.pas System.Net.Socket.hpp |
System.Net.Socket | TSocket |
Description
Creates an instance of TSocket.
Create accepts the following parameters:
ASocket
is the socket handle of your socket object. You can create a socket handle using CreateSocket.AAddr
is the local or remote IP address that your socket can use to bind (server side) or connect (client side). You can use InitSocket to obtain a local IP address that you can pass as the value ofAAddr
.ASockType
is the type of your socket.AEncoding
is the encoding of your socket.