Click here to Skip to main content
15,907,326 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon13-Sep-07 6:03
Beaon13-Sep-07 6:03 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Mark Salsbery13-Sep-07 6:15
Mark Salsbery13-Sep-07 6:15 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon13-Sep-07 6:59
Beaon13-Sep-07 6:59 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Mark Salsbery13-Sep-07 7:04
Mark Salsbery13-Sep-07 7:04 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon14-Sep-07 3:43
Beaon14-Sep-07 3:43 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Mark Salsbery14-Sep-07 6:04
Mark Salsbery14-Sep-07 6:04 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon14-Sep-07 6:20
Beaon14-Sep-07 6:20 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon14-Sep-07 8:22
Beaon14-Sep-07 8:22 
Alrighty sir, I swear I wouldnt be asking if I could find the answer somewhere in a tutorial but so far no luck.

Everywhere I read says that in order to make these sockets compatible with my GUI I need to have an async socket.

I understand that, my problem is where exactly do I put the WSAAsyncSelect command?

I have tried both places.

Create Listenign Socket
Bind Listening SOcket
Listen Listening SOcket

Create Client Socket
WSAAsyncSelect(Client Socket) //Ive tried it here
Client SOcket = accept (Listening Socket)
//WSAAsyncSelect(Client Socket) //And I have tried it here.

If I try it higher up before I make the accept call, that place seems the most logical to me because it is the accept call that locks up the gui right? However when I do it the GUI locks up. If I telnet to my port, or use my little console program I made and connect to that port the GUI unfreezes and a connection is established as normal. If I try to send data nothing is received on my GUI end.

If I place the WSAAsyncSelect after the Accept command same thing. Client GUI hangs untill a connection is established. Once its established everything works however, I can even send text messages from my console program and it will output correctly on my GUI's interface.

I am guessing that I am assigning the correct socket into async mode and my windows messages are working and everything, but why would it still be locking up waiting for a connect? Perhaps I am missing something still!

I spent the last hour poken around MSDN libs and other sites and havnt been able to get a simple and descent example. Thanks again Mark, especially for your patience!



Cliff
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Mark Salsbery14-Sep-07 12:39
Mark Salsbery14-Sep-07 12:39 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon17-Sep-07 5:49
Beaon17-Sep-07 5:49 
AnswerRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon17-Sep-07 9:21
Beaon17-Sep-07 9:21 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Mark Salsbery17-Sep-07 9:43
Mark Salsbery17-Sep-07 9:43 
QuestionDisplaying text in non-english language on console [modified] Pin
ComplexLifeForm12-Sep-07 7:02
ComplexLifeForm12-Sep-07 7:02 
AnswerRe: Displaying text in non-english language on console Pin
Matthew Faithfull12-Sep-07 8:21
Matthew Faithfull12-Sep-07 8:21 
QuestionExiting process Pin
koumodaki12-Sep-07 6:16
koumodaki12-Sep-07 6:16 
AnswerRe: Exiting process Pin
Hamid_RT12-Sep-07 6:44
Hamid_RT12-Sep-07 6:44 
AnswerRe: Exiting process Pin
Mark Salsbery12-Sep-07 6:45
Mark Salsbery12-Sep-07 6:45 
AnswerRe: Exiting process Pin
aks.12-Sep-07 15:49
aks.12-Sep-07 15:49 
Questionproblem with multithreading and wrapper-class object Pin
kyer12-Sep-07 4:53
kyer12-Sep-07 4:53 
AnswerRe: problem with multithreading and wrapper-class object Pin
Randor 12-Sep-07 4:59
professional Randor 12-Sep-07 4:59 
GeneralRe: problem with multithreading and wrapper-class object Pin
kyer12-Sep-07 5:30
kyer12-Sep-07 5:30 
GeneralRe: problem with multithreading and wrapper-class object Pin
Randor 12-Sep-07 6:07
professional Randor 12-Sep-07 6:07 
GeneralRe: problem with multithreading and wrapper-class object Pin
kyer12-Sep-07 8:23
kyer12-Sep-07 8:23 
AnswerSolution Pin
kyer12-Sep-07 9:12
kyer12-Sep-07 9:12 
Questionexcel problem Pin
tunminhein12-Sep-07 4:28
tunminhein12-Sep-07 4:28 

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.