Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tcp/ip communication in C

Status
Not open for further replies.

pmm9876

Programmer
Oct 25, 2001
3
US
Hi All,

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?

Thanks,

Praveen


 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top