Click here to Skip to main content
       

ATL / WTL / STL

 
QuestionSQL Server Compact Edition PinmemberHaakon S.11-Feb-13 4:23 
AnswerRe: SQL Server Compact Edition PinmvpRichard MacCutchan11-Feb-13 4:42 
GeneralRe: SQL Server Compact Edition PinmemberHaakon S.11-Feb-13 5:37 
GeneralRe: SQL Server Compact Edition PinmvpRichard MacCutchan11-Feb-13 5:58 
Questionerror while trying to uplaod the file in current directory using c language Pinmemberraghvendrapanda30-Jan-13 19:34 
AnswerRe: error while trying to uplaod the file in current directory using c language PinmvpRichard MacCutchan30-Jan-13 22:03 
AnswerRe: error while trying to uplaod the file in current directory using c language Pinmember«_Superman_»1-Feb-13 20:34 
QuestionTCP/IP CAsyncSocket and pointers to same Pinmemberbkelly1324-Jan-13 15:16 
Environment Windows XP and 7, Visual Studio 2008, C++.
Experience level: novice with TCP/IP, but do have the application working with CAsyncSocket.
 
The message application receives telemetry data from some hardware (arrives fast and furious), processes it and dispatches the results to a display device via TCP/IP.   It sends the data to the client but does not receive from the client.
 
Setup:   the TCP “Manager” is started by the main application and it listens for the client.   On connect, it creates the “Sender” that does all the sending.

Question:   what is the best, read that simple and maintainable, way for the manager to get the Sender pointer to the main application so it can use the Sender?   When the client closes the connection, how is the application informed of that?
 
Tentative proposal:   the application provides the Manager with a pointer to itself.   When the connect is made the Manager calls an application method such as
Set_TCP_Sender_Pointer( C_Sender_Class *new_sender_pointer );
 
The Manager can pass the pointer (to the main application) to the Sender on creation.   When the Sender gets a close from the client, it calls the same method using a NULL for the argument.   This makes the application aware there is no Sender.   Then the Sender exits.   (There is only one thread so I think there is no concern about the application using a pointer to a non-existent Sender.)
 
I am pretty sure that will work, but if you had to pick up on this project, would it be easy to understand and maintain?   Presume you are not an expert with TCP/IP in the Microsoft world.
I am open to alternative suggestions.
 
Thanks for your time
Answerclasses don't call upwards Pinmemberbkelly1326-Jan-13 8:55 
QuestionATL and exceptions Pinmemberimagiro14-Jan-13 8:10 
AnswerRe: ATL and exceptions PinmemberJonathan Davies18-Jan-13 9:39 
AnswerRe: ATL and exceptions Pinmemberbkelly1324-Jan-13 15:24 
GeneralRe: ATL and exceptions PinmemberJonathan Davies6-Feb-13 7:23 
GeneralRe: ATL and exceptions PinmemberAlbert Holguin11-Feb-13 5:12 
Questionunicode and non-unicode Pinmemberbkelly1314-Jan-13 3:45 
AnswerRe: unicode and non-unicode PinmvpRichard MacCutchan14-Jan-13 6:24 
GeneralRe: unicode and non-unicode [modified] Pinmemberbkelly1314-Jan-13 8:43 
GeneralRe: unicode and non-unicode PinmvpRichard MacCutchan14-Jan-13 22:13 
GeneralRe: unicode and non-unicode PinmvpRichard MacCutchan20-Jan-13 22:08 
AnswerRe: unicode and non-unicode Pinmemberpasztorpisti20-Jan-13 1:33 
GeneralRe: unicode and non-unicode Pinmemberbkelly1320-Jan-13 8:56 
GeneralRe: unicode and non-unicode Pinmemberpasztorpisti20-Jan-13 10:45 
AnswerRe: unicode and non-unicode PinmemberAlbert Holguin11-Feb-13 5:10 
Questionsqlconfigdatasource fails on 64 bit from 64 application Pinmemberkhaliloenit10-Jan-13 23:02 
AnswerRe: sqlconfigdatasource fails on 64 bit from 64 application PinmvpRichard MacCutchan10-Jan-13 23:10 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 10 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid