Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: About Windows OS Pin
Nemanja Trifunovic22-Jun-06 7:45
Nemanja Trifunovic22-Jun-06 7:45 
GeneralRe: About Windows OS Pin
Zac Howland22-Jun-06 9:22
Zac Howland22-Jun-06 9:22 
GeneralRe: About Windows OS Pin
Nemanja Trifunovic22-Jun-06 9:48
Nemanja Trifunovic22-Jun-06 9:48 
GeneralRe: About Windows OS Pin
Zac Howland22-Jun-06 9:58
Zac Howland22-Jun-06 9:58 
GeneralRe: About Windows OS Pin
Nemanja Trifunovic22-Jun-06 11:45
Nemanja Trifunovic22-Jun-06 11:45 
GeneralRe: About Windows OS Pin
Zac Howland23-Jun-06 3:21
Zac Howland23-Jun-06 3:21 
AnswerRe: About Windows OS Pin
Stephen Hewitt22-Jun-06 14:24
Stephen Hewitt22-Jun-06 14:24 
QuestionSynchronous/Ascynchronous sockets Pin
CMas0722-Jun-06 3:58
CMas0722-Jun-06 3:58 
Hey. I'm fairly new to MC socket programming, and had a difficult question that I've been wrestling with over the past couple weeks to find a solution.

I need to be able to make a single-threaded (or at least no more than 3 or so) TCP client/server application. I would like to try to use the CAsyncSocket and CSocket objects provided, and have on the Server side:
synchronous Accepts, asynchronous Receives/Sends

and on the Client side:
everything synchronous

So the first question is would this even be possible?

If it is, I'm thinking that I should be able to listen with a CSocket object, and pass a CAsyncSocket object to the Accept function on the Server side, while on the Client side I'm Connecting from a CSocket. Would this provide my desired functionality? Or is there something else that I need to think about?

With regards to the threading, I wasn't sure how to keep listening for accepts while receiving from/sending to multiple clients on one thread, so I thought that having three threads (one for accepting, one for sending, and one for receiving) would be the best option. Again, threading is something that I'm new to as well, so I wasn't sure how that would fair either.

If anyone could possibly give me some pointers on how to accomplish this, or where to look to get some good info (I'm about googled out on this), I would greatly appreciate it.

Thanks!

Richard Alley
Student/Software Engineer
AnswerRe: Synchronous/Ascynchronous sockets Pin
Zac Howland22-Jun-06 5:29
Zac Howland22-Jun-06 5:29 
GeneralRe: Synchronous/Ascynchronous sockets Pin
led mike22-Jun-06 5:36
led mike22-Jun-06 5:36 
GeneralRe: Synchronous/Ascynchronous sockets Pin
Zac Howland22-Jun-06 6:13
Zac Howland22-Jun-06 6:13 
GeneralRe: Synchronous/Ascynchronous sockets Pin
led mike22-Jun-06 7:22
led mike22-Jun-06 7:22 
GeneralRe: Synchronous/Ascynchronous sockets Pin
Zac Howland22-Jun-06 7:24
Zac Howland22-Jun-06 7:24 
GeneralRe: Synchronous/Ascynchronous sockets Pin
CMas0722-Jun-06 5:58
CMas0722-Jun-06 5:58 
GeneralRe: Synchronous/Ascynchronous sockets Pin
Zac Howland22-Jun-06 6:18
Zac Howland22-Jun-06 6:18 
QuestionRe: Synchronous/Ascynchronous sockets Pin
CMas075-Jul-06 3:34
CMas075-Jul-06 3:34 
AnswerRe: Synchronous/Ascynchronous sockets Pin
Zac Howland5-Jul-06 4:44
Zac Howland5-Jul-06 4:44 
GeneralRe: Synchronous/Ascynchronous sockets Pin
CMas075-Jul-06 5:02
CMas075-Jul-06 5:02 
GeneralRe: Synchronous/Ascynchronous sockets Pin
Zac Howland5-Jul-06 5:13
Zac Howland5-Jul-06 5:13 
AnswerRe: Synchronous/Ascynchronous sockets Pin
led mike22-Jun-06 5:34
led mike22-Jun-06 5:34 
GeneralRe: Synchronous/Ascynchronous sockets Pin
CMas0722-Jun-06 6:02
CMas0722-Jun-06 6:02 
Questionhow to open a *.txt file Pin
divisameer22-Jun-06 3:58
divisameer22-Jun-06 3:58 
AnswerRe: how to open a *.txt file Pin
toxcct22-Jun-06 3:59
toxcct22-Jun-06 3:59 
QuestionRe: how to open a *.txt file Pin
David Crow22-Jun-06 4:06
David Crow22-Jun-06 4:06 
AnswerRe: how to open a *.txt file Pin
Hamid_RT22-Jun-06 20:10
Hamid_RT22-Jun-06 20:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.