Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL Templates and Polymorphism Pin
Jörgen Sigvardsson14-Nov-07 11:10
Jörgen Sigvardsson14-Nov-07 11:10 
AnswerRe: STL Templates and Polymorphism Pin
Mark Salsbery14-Nov-07 10:01
Mark Salsbery14-Nov-07 10:01 
GeneralRe: STL Templates and Polymorphism [modified] Pin
led mike14-Nov-07 10:47
led mike14-Nov-07 10:47 
GeneralRe: STL Templates and Polymorphism Pin
Mark Salsbery14-Nov-07 11:17
Mark Salsbery14-Nov-07 11:17 
GeneralRe: STL Templates and Polymorphism Pin
led mike14-Nov-07 11:46
led mike14-Nov-07 11:46 
GeneralRe: STL Templates and Polymorphism Pin
Mark Salsbery14-Nov-07 12:10
Mark Salsbery14-Nov-07 12:10 
AnswerRe: STL Templates and Polymorphism Pin
Stephen Hewitt14-Nov-07 13:19
Stephen Hewitt14-Nov-07 13:19 
QuestionTCP client/server data exchange Pin
bigdenny20014-Nov-07 9:00
bigdenny20014-Nov-07 9:00 
Hey all,

I wrote a simple TCP server client application, where client is sending some text to the server.
I based the implementation on Nish's article: http://www.codeproject.com/internet/winsockintro02.asp.

But I have one problem. For example, when I want to send data "hello" to server, I use the send(..) method, for which I have a correcsponding receive(..) method on the server side.

My problem is that if I want to send for example two data objects: "hello" and "hello again", with two 1. send("hello",..); 2. send("hello again",..); and two receive(..); receive(..); methods. I am still not managing to receive data on the server side in the appropriate order. Sometimes I will receive "hellohelloagain" sometimes I will receive data as I had sent them, i.e. "hello" and "helloagain".

Can anyone give me a clue how to implement the program such that I can seperately send differenttext data from client, i.e. text[1], ...., text[n] and easily receive this data in the same manner, on the server side ?

Thanks.
AnswerRe: TCP client/server data exchange Pin
Mark Salsbery14-Nov-07 9:19
Mark Salsbery14-Nov-07 9:19 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 10:09
bigdenny20014-Nov-07 10:09 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery14-Nov-07 10:11
Mark Salsbery14-Nov-07 10:11 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 10:14
bigdenny20014-Nov-07 10:14 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery14-Nov-07 10:19
Mark Salsbery14-Nov-07 10:19 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 11:15
bigdenny20014-Nov-07 11:15 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery14-Nov-07 11:37
Mark Salsbery14-Nov-07 11:37 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 11:56
bigdenny20014-Nov-07 11:56 
GeneralRe: TCP client/server data exchange Pin
Mark Salsbery14-Nov-07 12:12
Mark Salsbery14-Nov-07 12:12 
GeneralRe: TCP client/server data exchange Pin
Jörgen Sigvardsson14-Nov-07 11:14
Jörgen Sigvardsson14-Nov-07 11:14 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 11:17
bigdenny20014-Nov-07 11:17 
GeneralRe: TCP client/server data exchange Pin
Jörgen Sigvardsson14-Nov-07 21:33
Jörgen Sigvardsson14-Nov-07 21:33 
AnswerRe: TCP client/server data exchange Pin
JudyL_MD14-Nov-07 10:03
JudyL_MD14-Nov-07 10:03 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 10:12
bigdenny20014-Nov-07 10:12 
GeneralRe: TCP client/server data exchange Pin
JudyL_MD14-Nov-07 10:19
JudyL_MD14-Nov-07 10:19 
GeneralRe: TCP client/server data exchange Pin
Jörgen Sigvardsson14-Nov-07 11:16
Jörgen Sigvardsson14-Nov-07 11:16 
GeneralRe: TCP client/server data exchange Pin
bigdenny20014-Nov-07 11:19
bigdenny20014-Nov-07 11:19 

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.