TCP Socket programming -- C --Windows

kishan66
kishan66 used Ask the Experts™
on
Hi ,
Can you please tell me how to write a simple Tcp-Socket programming using C.
lets suppose i have to communicate to xx.xx.xx.xx:5000.

--i as a client should send a packet  to the server .
--packet-> is a structure with some data.
--server should respond with the acknowledgment...

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2009
Commented:
I usually do not like to just give links but this is a big question.

You really need to Google winsock tutorials and do one completely. Learning socket programming is too much for this thread, but you are welcome to try a tutorial you find and then ask questions here and we will guide you.

Here is one I found:

http://www.tenouk.com/Winsock/Winsock2example9.html

And don't forget to check the source at MSDN

http://msdn.microsoft.com/en-us/library/ms738545(VS.85).aspx

Jaime OlivaresSoftware Architect
Top Expert 2008
Commented:
Indeed this is a long question for a longer answer.
There are lots of examples in internet, but please specify first:
OS, compiler, main library

Author

Commented:
hi ,

thanks for the links...
will go through them.first

any ways my environment-: C,Windows
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Jaime OlivaresSoftware Architect
Top Expert 2008

Commented:
so, are you using Visual C++? MFC? .Net? Just WinAPI?
evilrixSenior Software Engineer (Avast)
Commented:
This is a pretty thorough guide to developing network programs.

Beej's Guide to Network Programming
Using Internet Sockets
http://www.beej.us/guide/bgnet/

Author

Commented:
Thank you guys for the Helpful links.

mrjoltcola:

thanks for the initial suggestion.

i could able to establisg n communicate uisng TCP now.

Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial