[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [C/C++] TCP/IP byte-order kommunikation



On 30 Jan 2004 19:51:09 +0100
Peter Makholm <sslug@sslug> wrote:

> Jeg kender ikke lige det framework du bruger, men list løst:

Qt...

 
> >   if( s->bytesAvailable() >= sizeof(ProtocolHeader) ) {
> >     ProtocolHeader ph;
> >     Q_LONG len = 0;
> >     Q_ULONG left = 0;
> >     if( s->readBlock( (char *)&ph, sizeof(ProtocolHeader)) != -1 ) {
> 
> Her har du allerede antaget at at int er af en fast størelse og når du
> anvender værdien af ph.size lidt efter antager du at endianess er den
> samme i begge ender.

Jeg er klar over det med størrelsen af variabler. Jeg har ikke erfaring
med 64 bits maskiner så jeg ved ikke lige pt. hvordan man løser det
problem!

Ang. endians: Det tager Qt sig af !

I øvrigt var koden også kun et meget hurtigt hack... værken testet eller
noget som helst andet!

(John =;-)


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *