🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Winsock 2

Started by
0 comments, last by ClonedDragon 23 years, 10 months ago
Hi Everybody, I''m working on a matchmaking service over NT, and i have a couple of questions for anyone using winsock 2. - What is the advantage of using winsock 2?? (over winsock 1.1) - Is there any way of getting a windows handle to a socket that can be used in a WaitFor.. call?? Thanks, in advance..
Advertisement
quote:
- What is the advantage of using winsock 2?? (over winsock 1.1)



- Quote from WinSock2 help:
Windows Sockets 2 utilizes the sockets paradigm that was first popularized by Berkeley Software Distribution (BSD) UNIX. It was later adapted for Microsoft Windows in the Windows Sockets 1.1.

One of the primary goals of Windows Sockets 2 has been to provide a protocol-independent interface fully capable of supporting the emerging networking capabilities, such as real-time multimedia communications.
Windows Sockets 2 is an interface, not a protocol. As an interface, it is used to discover and utilize the communications capabilities of any number of underlying transport protocols. Because it is not a protocol, it does not in any way affect the "bits on the wire", and does not need to be utilized on both ends of a communications link.

Windows Sockets programming previously centered around TCP/IP. Some of the programming practices that worked with TCP/IP do not work with every protocol. As a result, the Windows Sockets 2 API added new functions where necessary.
Windows Sockets 2 has changed its architecture to provide easier access to multiple transport protocols. Following the Windows Open System Architecture (WOSA) model, Windows Sockets 2 now defines a standard service provider interface (SPI) between the application programming interface (API), with its functions exported from WS2_32.DLL, and the protocol stacks. Consequently, Windows Sockets 2 support is not limited to TCP/IP protocol stacks as is the case for Windows Sockets 1.1. For more information, see Windows Sockets 2 Architecture.

There are new challenges in developing Windows Sockets 2 applications. When sockets only supported TCP/IP, a developer could create an application that supported only two socket types: connectionless and connection-oriented. Connectionless protocols used SOCK_DGRAM sockets and connection-oriented protocols used SOCK_STREAM sockets. Now, these are just two of the many new socket types. Additionally, developers can no longer rely on socket type to describe all the essential attributes of a transport protocol.



quote:
- Is there any way of getting a windows handle to a socket that can be used in a WaitFor.. call??


- Nope, but you can use messages. I think it was WSAAsyncSelect(). After using messages, you could use WaitFor... calls, but the main message loop will probably do...?

This topic is closed to new replies.

Advertisement