This function creates a socket that is bound to a specific service provider.
|This function is actually a Winsock function. However, the information that is presented in it is specific to Bluetooth.|
SOCKET socket( int af, int type, int protocol );
[in] Address family specification. To create a Bluetooth socket, use: af = AF_BTH
[in] Type specification for the new socket. To create a Bluetooth socket, use:
type = SOCK_STREAM
[in] Protocol to be used with the socket that is specific to the indicated address family. To create a Bluetooth socket, use:
protocol = BTHPROTO_RFCOMM
If no error occurs, this function returns a descriptor referencing the new socket. If an error occurs, a value of INVALID_SOCKET is returned, and a specific error code can be retrieved by calling WSAGetLastError.