Solved

Using Sockets

Posted on 1998-12-18
2
178 Views
Last Modified: 2013-11-20
I'd like to know how to use, in a MFC program, sockets to send and recieve data. I am working on a client application that will need to connect and send data to various other machines. It really seems simple but I am soooo lost. Everything in the MFC samples on the VC++ 5 cd involves using archives, and the other end will not always be a windows machine. I'm pretty familiar with MFC programming, so I would just need an example of how to declare the Socket and send and how to hook the listening end up.
0
Comment
Question by:jcorbin
  • 2
2 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1326394
The basics are those:
1. Create a derived class from CSocket or CAsyncSocket
2. For a client side, use Connect to connect to the host
3. Use Send to send data
4. In the OnReceive handler, use Receive to receive the data.

If you need any more help, just ask.
0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1326395
The basics are those:
1. Create a derived class from CSocket or CAsyncSocket
2. For a client side, use Connect to connect to the host
3. Use Send to send data
4. In the OnReceive handler, use Receive to receive the data.

If you need any more help, just ask.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now