I am trying to write a code in C, which uses tcp/ip communication. So is possible to do so, as i have never done this before. If yes what would be a good approach?
It is possible , but sometimes it goes a little too low into details. Comparing to Winsock Control from VB for example is more complicated but it allows a lot more fine- tuning and allow for multiple client connection on the same socket(port actually).
A. With MFC:
Uee and read about CSocket and CAsyncSocket classes. CAsyncSocket is the base class and you should use it if you need some more help
A. With SDK:
use the functions from WSock.dll: like listen, connnect, close, getsockname, getpeename and so on. Here you are forced to make the fine tuning.
HTH,
s-)
Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
Never use the MFC classes CSocket and CAsyncSocket, they are very unstable for long term usage.
Using the winsock api is difficult but possible, I was able to work with it so almost everyone can.
If you are looking for client (or server) support for common protocals (FTP, telnet, nntp etc) I suggest buying a commercial package. I have used Dundas for 2 years in many applications without any problems.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.