Click here to Skip to main content
15,886,052 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [Win32]Set bitmap to button Pin
Chris Losinger15-Jun-11 8:33
professionalChris Losinger15-Jun-11 8:33 
GeneralRe: [Win32]Set bitmap to button Pin
Member 296547115-Jun-11 9:01
Member 296547115-Jun-11 9:01 
GeneralRe: [Win32]Set bitmap to button Pin
Richard MacCutchan15-Jun-11 21:15
mveRichard MacCutchan15-Jun-11 21:15 
GeneralRe: [Win32]Set bitmap to button Pin
Member 296547115-Jun-11 22:34
Member 296547115-Jun-11 22:34 
GeneralRe: [Win32]Set bitmap to button [modified] Pin
Richard MacCutchan16-Jun-11 3:22
mveRichard MacCutchan16-Jun-11 3:22 
AnswerRe: [Win32]Set bitmap to button Pin
Abhi Lahare15-Jun-11 8:32
Abhi Lahare15-Jun-11 8:32 
GeneralRe: [Win32]Set bitmap to button Pin
Member 296547115-Jun-11 8:35
Member 296547115-Jun-11 8:35 
QuestionCAsyncSocket - Connection Recovery Pin
burns86315-Jun-11 6:31
burns86315-Jun-11 6:31 
Hi,

I've been working with some code that uses a TCP connection for the past few weeks. I have a socket class derived from CAsyncSocket.

Everything works fine initially. I instantiate my manager class which wraps around the socket class and calls connect (via a member pointer to the socket class). I am then able to send a receive data. The problem comes when there is a socket error. For a currently unknown reason, part of my code is causing a socket error. I have yet to find where this is happening but the problem forced me to test out the part of my code which shoudl attempt to recover the connection. It doesn't work, and I can't get things going.

I have overriden OnClose, which calls a method on the manager class (its parent) called OnSocketClose. This calls socket.shutdown(), socket.close() and 'delete socket'. It then sets the pointer to 0. From here, the next time I attempt to send anything down the socket it looks for the socket pointer == 0, to indicate that it should create a pointer to a new socket.

This new socket is created but fails to connect. I have got it to appear connected on a couple of occasions by moving things around but OnConnect doesn't seem to get called and I am unable to send data. The returned value from socket.connect however reports that the socket is already connected if I call socket.connect again, after a short period of time from the first call to connect (socket error 10056).

Apologies if this sounds a little confusing, but I think I have managed to confuse myself... massively Confused | :confused:

If it will help, I can post code? Just let me know which parts you need to see.

Thanks!
AnswerRe: CAsyncSocket - Connection Recovery Pin
burns86316-Jun-11 3:18
burns86316-Jun-11 3:18 
QuestionRouting Enter/Return key press to a Dialog Pin
dipuks15-Jun-11 4:33
dipuks15-Jun-11 4:33 
AnswerRe: Routing Enter/Return key press to a Dialog Pin
Abhi Lahare15-Jun-11 4:51
Abhi Lahare15-Jun-11 4:51 
GeneralRe: Routing Enter/Return key press to a Dialog Pin
dipuks15-Jun-11 5:31
dipuks15-Jun-11 5:31 
GeneralRe: Routing Enter/Return key press to a Dialog Pin
Abhi Lahare15-Jun-11 7:01
Abhi Lahare15-Jun-11 7:01 
AnswerRe: Routing Enter/Return key press to a Dialog Pin
Albert Holguin15-Jun-11 5:12
professionalAlbert Holguin15-Jun-11 5:12 
QuestionRe: Routing Enter/Return key press to a Dialog Pin
David Crow15-Jun-11 5:57
David Crow15-Jun-11 5:57 
QuestionProblem in creating dsn using sqlconfigdatasource() Pin
shashankacharya15-Jun-11 0:58
shashankacharya15-Jun-11 0:58 
AnswerRe: Problem in creating dsn using sqlconfigdatasource() Pin
David Crow15-Jun-11 2:09
David Crow15-Jun-11 2:09 
AnswerRe: Problem in creating dsn using sqlconfigdatasource() Pin
gaspher17-Jun-11 13:06
gaspher17-Jun-11 13:06 
QuestionVPN Server and Client Pin
dwk0014-Jun-11 22:34
dwk0014-Jun-11 22:34 
QuestionEquation for a straight line Pin
Cyclone_S14-Jun-11 13:48
Cyclone_S14-Jun-11 13:48 
AnswerRe: Equation for a straight line Pin
tolw14-Jun-11 19:27
tolw14-Jun-11 19:27 
GeneralRe: Equation for a straight line Pin
Cyclone_S15-Jun-11 10:31
Cyclone_S15-Jun-11 10:31 
GeneralRe: Equation for a straight line Pin
tolw15-Jun-11 18:56
tolw15-Jun-11 18:56 
GeneralRe: Equation for a straight line Pin
Stefan_Lang15-Jun-11 23:48
Stefan_Lang15-Jun-11 23:48 
GeneralRe: Equation for a straight line Pin
Cyclone_S17-Jun-11 15:13
Cyclone_S17-Jun-11 15:13 

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.