12/24/2020 0 Comments Winsock Control
IrDA utilizes a services title to create a connection rather of port numbers such as TCP.
![]() They also arranged the LocalPort house to the slot amount that the control will make use of to obtain data. After the slot number will be established, the Winsock handle can pay attention for data arriving at the slot. To configure a Winsock control to listen on the port, contact the Listen method. When a customer tries to connect to the server program, the Winsock control generates the ConnectionRequest occasion. If the Winsock handle successfully welcomes the link, it starts the Connect event and pieces the RemoteHostIP and RemotePort properties with the IP tackle and port quantity of the connecting customer. After a link is produced, the control pieces the State real estate to sckConnected. A linked Winsock control receives information through the connection. When information is delivered to the machine, the Winsock handle creates the DataArrival occasion, showing that the data can be study from the handle. ![]() To send out data through a connected Winsock handle, use the SendData technique. As information is sent through the control to the IP tackle and port number selected in the RemoteHostlP and RemotePort qualities, the Winsock handle creates the SendProgress event to inform the coder of the quantity of bytes sent and the amount of bytes still left to send. When the data transfer will be full, the control generates the SendComplete occasion. After all data transfer is certainly completed, shut the TCPIP link by phoning the Close up method. When a connection closes, the control produces the Close up event. In add-on to the Connect and Close occasions, the Winsock handle can initiate the Error occasion to notify the coder of network errors. Unlike handle mistakes or code errors, network errors do not really trigger a run-time mistake, but only raise the Mistake event. To create a customer application, fixed the RemoteHost and RemotePort properties, then contact the Connect technique. Once the link to the server is established, transfer data as usual by using the SendData and GetData methods. In inclusion to the TCPIP process, the Winsock handle supports sending data over an infrared interface using the IrDA process. To use IrDA, fixed the Process real estate to 2; then set the ServiceName residence to a chain. The thread signifies the service name for an IrDA link.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |