Click to See Complete Forum and Search --> : winsock issue


eHunter
May 30th, 2002, 06:12 AM
Hi Friends,

Out of winsock.h and winsock2.h which is better to use in windows based application in terms of performance and future compatiabilty with other windows components.

Please let me know.

Thanks

Sarma

jparsons
May 30th, 2002, 08:34 AM
Originally posted by eHunter
Hi Friends,

Out of winsock.h and winsock2.h which is better to use in windows based application in terms of performance and future compatiabilty with other windows components.

Sarma

"winsock2.h" api is much better/clean than winsock.h. The library has much richer function calls that allow you to do things like asyncrhonus I/O which is not possible in the winsocket v1. However winsock v1 is almost a complete berkely socket implementation. If you write your programs with that, it will be much easier to port over to Unix/Linux later.

Jupiter
May 30th, 2002, 08:01 PM
Well it all depends upon the kind of application you are going to develop and you need. If you are just looking at windows then ofcourse winsock2.h is better because of its richness. But if you are planning to port your application over other os like linux then at that time it will make you job easier if you ve used winsock.h. Again it all depends on you need and requirements so you can not generalise it.

- Hemant