Winsock is typically used with the TCP/IP protocols. Infrared Sockets (IrSock), is an extension to Winsock that allows it to be used also for IR communication using the IrDA protocol. Each endpoint must support an IrDA-compliant device and an IrDA-compliant protocol stack.
Some Winsock functions work differently with IrDA than they do with TCP/IP. The principal differences are:
Conventional Winsock name service is best suited to fixed networks in which the group of devices that can accept a socket connection is relatively static. Conversely, IrDA is designed to handle browsing for whatever resources are within range. It works in an ad hoc manner, and devices come and go frequently as they move in and out of range.
Because of these differences, IrSock does not use the conventional Winsock name service functions. Instead, name service is incorporated into the communication stream.
Addressing is based on logical Service Access Point Selectors (LSAP-SELs), numbered from 1 through 127. Because of the small range of values available, it is usually better not to bind sockets directly to an LSAP-SEL. Instead, the Information Access Service (IAS) provides a means for dynamic binding of sockets to LSAP-SELs.
To use IAS, a server application binds a socket to an IAS service name. The client application uses the service name when connecting. Neither application knows, or needs to know, the LSAP-SEL that is assigned by the IAS. This procedure is outlined in the following sections.
Windows CE includes two socket options to access the unique features of the IrDA protocol: