Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question"global namespace" ---what's meaning of this?? Pin
tank10258-Apr-04 18:58
tank10258-Apr-04 18:58 
AnswerRe: "global namespace" ---what's meaning of this?? Pin
Renjith Ramachandran8-Apr-04 22:35
Renjith Ramachandran8-Apr-04 22:35 
Generalsocket send/recv Pin
Steve L.8-Apr-04 18:06
Steve L.8-Apr-04 18:06 
GeneralRe: socket send/recv Pin
johnny,Kim8-Apr-04 20:43
johnny,Kim8-Apr-04 20:43 
GeneralRe: socket send/recv Pin
toxcct8-Apr-04 21:49
toxcct8-Apr-04 21:49 
GeneralRe: socket send/recv Pin
Steve L.9-Apr-04 7:27
Steve L.9-Apr-04 7:27 
GeneralRe: socket send/recv Pin
toxcct9-Apr-04 10:30
toxcct9-Apr-04 10:30 
GeneralRe: socket send/recv Pin
Paul Ranson9-Apr-04 9:46
Paul Ranson9-Apr-04 9:46 
Are you using UDP? If so then you will probably find that both 'longs' were returned in the same message and that since you haven't read the whole message the remainder has been discarded.

Byte order is a matter for the client and server to agree upon, in this case it's a secondary issue since you aren't able to see the right data, byte reversed or not.

I would expect you to have to do something like,

long lReq ;

lReq = htonl ( 123456 ) ;

sendto ( s, &lReq, sizeof ( lReq ), ... ) ;

...

long Response [ 2 ] ;

recv ( s, Response, sizeof ( resp ), 0 ) ;

long lR1 = ntohl ( Response [ 0 ]) ;
long lR2 = ntohl ( Response [ 1 ]) ;


If you're using connected TCP sockets then ignore this...

Paul
GeneralAccess to class in another file. Pin
Iceberg768-Apr-04 16:33
Iceberg768-Apr-04 16:33 
GeneralRe: Access to class in another file. Pin
Maxwell Chen8-Apr-04 17:00
Maxwell Chen8-Apr-04 17:00 
GeneralRe: Access to class in another file. Pin
Iceberg768-Apr-04 17:32
Iceberg768-Apr-04 17:32 
GeneralRe: Access to class in another file. Pin
Maxwell Chen8-Apr-04 17:47
Maxwell Chen8-Apr-04 17:47 
GeneralRe: Access to class in another file. Pin
Iceberg768-Apr-04 18:04
Iceberg768-Apr-04 18:04 
GeneralRe: Access to class in another file. Pin
Iceberg769-Apr-04 20:28
Iceberg769-Apr-04 20:28 
GeneralRe: Access to class in another file. Pin
Maxwell Chen11-Apr-04 16:39
Maxwell Chen11-Apr-04 16:39 
GeneralRe: Access to class in another file. Pin
Iceberg7611-Apr-04 20:09
Iceberg7611-Apr-04 20:09 
Generalneed helps for writing voice chat program in Visual C++ Pin
NgocHung8-Apr-04 15:12
NgocHung8-Apr-04 15:12 
GeneralRe: need helps for writing voice chat program in Visual C++ Pin
Timothy Grabrian8-Apr-04 15:41
professionalTimothy Grabrian8-Apr-04 15:41 
GeneralRe: need helps for writing voice chat program in Visual C++ Pin
NgocHung9-Apr-04 3:31
NgocHung9-Apr-04 3:31 
GeneralDoes Directory Exists Pin
Timothy Grabrian8-Apr-04 14:05
professionalTimothy Grabrian8-Apr-04 14:05 
GeneralRe: Does Directory Exists Pin
gUrM33T8-Apr-04 14:49
gUrM33T8-Apr-04 14:49 
GeneralRe: Thanks Pin
Timothy Grabrian8-Apr-04 15:12
professionalTimothy Grabrian8-Apr-04 15:12 
GeneralRe: Thanks Pin
8-Apr-04 15:38
suss8-Apr-04 15:38 
GeneralRe: Thanks Pin
Timothy Grabrian8-Apr-04 15:52
professionalTimothy Grabrian8-Apr-04 15:52 
GeneralWM_SYSCOMMAND & SC_MOUSEMENU Pin
Anonymous8-Apr-04 13:38
Anonymous8-Apr-04 13:38 

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.