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:
ASocketis the socket handle of your socket object. You can create a socket handle using CreateSocket.AAddris 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.ASockTypeis the type of your socket.AEncodingis the encoding of your socket.