Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL or <afxtempl.h> Pin
s o v a n n26-Dec-05 19:21
s o v a n n26-Dec-05 19:21 
QuestionSend file/string Pin
mambohoe8122-Dec-05 18:47
mambohoe8122-Dec-05 18:47 
AnswerRe: Send file/string Pin
Owner drawn22-Dec-05 21:00
Owner drawn22-Dec-05 21:00 
AnswerRe: Send file/string Pin
vikas amin22-Dec-05 22:15
vikas amin22-Dec-05 22:15 
GeneralRe: Send file/string Pin
mambohoe8122-Dec-05 23:12
mambohoe8122-Dec-05 23:12 
AnswerRe: Send file/string Pin
Gary R. Wheeler24-Dec-05 3:19
Gary R. Wheeler24-Dec-05 3:19 
GeneralRe: Send file/string Pin
mambohoe8124-Dec-05 5:42
mambohoe8124-Dec-05 5:42 
GeneralRe: Send file/string Pin
Gary R. Wheeler24-Dec-05 9:53
Gary R. Wheeler24-Dec-05 9:53 
The way this works is that everything that is sent on the socket is a message. The sender will send a type, a length value, and the number of data bytes specified by the length. The receiver does the corresponding. It reads the type value, then the length, and then reads the number of data bytes specified by the length. Using this approach, you always know what type of data is being sent by the other end of the connection, and how big it is.

I would suggest making two simple test programs, a client program and a server program. You can run both of them at the same time on the same machine using IP address 127.0.0.1. You can then debug both of them simultaneously.

You might try looking at the articles in the Internet & Network Programming[^] section of Code Project. There are a number of good examples of this kind of approach.


Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
GeneralRe: Send file/string Pin
mambohoe8127-Dec-05 0:47
mambohoe8127-Dec-05 0:47 
QuestionWhy DeviceIoControl always return 0? Pin
kkwu21622-Dec-05 17:08
kkwu21622-Dec-05 17:08 
Questionreplace usp10.dll Pin
dung nam22-Dec-05 14:25
dung nam22-Dec-05 14:25 
Questionwriting native windows service using vc++2005 Pin
orid22-Dec-05 13:57
orid22-Dec-05 13:57 
QuestionDirection needed for MFC VC++ to open a text file Pin
Klerik8222-Dec-05 11:23
Klerik8222-Dec-05 11:23 
AnswerRe: Direction needed for MFC VC++ to open a text file Pin
Blake Miller22-Dec-05 11:28
Blake Miller22-Dec-05 11:28 
GeneralRe: Direction needed for MFC VC++ to open a text file Pin
Klerik8222-Dec-05 11:29
Klerik8222-Dec-05 11:29 
QuestionHelp needed. Writing an apps launcher. Pin
cgb14322-Dec-05 9:57
cgb14322-Dec-05 9:57 
AnswerRe: Help needed. Writing an apps launcher. Pin
Blake Miller22-Dec-05 10:11
Blake Miller22-Dec-05 10:11 
GeneralRe: Help needed. Writing an apps launcher. Pin
cgb14322-Dec-05 11:14
cgb14322-Dec-05 11:14 
GeneralRe: Help needed. Writing an apps launcher. Pin
Blake Miller22-Dec-05 11:27
Blake Miller22-Dec-05 11:27 
GeneralRe: Help needed. Writing an apps launcher. Pin
cgb14322-Dec-05 11:54
cgb14322-Dec-05 11:54 
GeneralRe: Help needed. Writing an apps launcher. Pin
Blake Miller22-Dec-05 11:59
Blake Miller22-Dec-05 11:59 
GeneralRe: Help needed. Writing an apps launcher. Pin
cgb14322-Dec-05 12:20
cgb14322-Dec-05 12:20 
GeneralRe: Help needed. Writing an apps launcher. Pin
Blake Miller23-Dec-05 5:13
Blake Miller23-Dec-05 5:13 
AnswerRe: Help needed. Writing an apps launcher. Pin
Michael Dunn22-Dec-05 21:23
sitebuilderMichael Dunn22-Dec-05 21:23 
QuestionSDK , VC++ and tty Pin
McSam22-Dec-05 8:59
McSam22-Dec-05 8:59 

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.