netch80: (bird)
[personal profile] netch80
address.sin_port = htons( ( port & 0xff )<<8 | (port & 0xff00) >> 8);


Смысл этой конструкции от меня ускользает. (Особенно, когда через несколько строк address.sin_port передаётся в функцию, которая ждёт значение в host order.)

А если в Java написать Integer.reverse(x) вместо Integer.reverseBytes(x), без привлечения утёнка проблема не решается.

Date: 2016-11-17 04:20 pm (UTC)
From: [identity profile] tzirechnoy.livejournal.com
А ты уверен, что та функцыя ждёт host order, а не little endian?

Date: 2016-11-17 06:38 pm (UTC)
From: [identity profile] tzirechnoy.livejournal.com
Ну, багрепорть, чо.

Profile

netch80: (Default)
netch80

January 2026

S M T W T F S
    1 23
45678910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 3rd, 2026 06:50 am
Powered by Dreamwidth Studios