void send(in DOMString data);
카테고리 없음 / 2017. 4. 24. 23:30
웹브라우져에서, 웹소켓으로 문자열을 보내니, 이상한 데이터만 나온다.
//웹브라우져 송신
wSocket.send("1111");
//서버수신데이터 len=28
88 96 E2 50 DB 09 E1 BA 92 67 94 31 B7 60 86 70 A9 6C 91 35 A9 7F 87 34 FB 6B 8B 24
//웹브라우져 송신
wSocket.send("1234567890");
//서버수신데이터 len=28
88 96 C8 73 9B 66 CB 99 D2 08 BE 12 F7 0F AC 53 E9 03 BB 16 E9 10 AD 17 BB 04 A1 07
//웹브라우져 송신
wSocket.send("12345");
//서버수신데이터 len=28
88 96 C3 F8 06 5F C0 12 4F 31 B5 99 6A 36 A7 D8 74 3A B0 9D 74 29 A6 9C 26 3D AA 8C
//웹브라우져 송신
wSocket.send("1234567890");
//서버수신데이터 len=28
88 96 D9 2D 39 7D DA C7 70 13 AF 4C 55 14 BD 0D 4B 18 AA 48 4B 0B BC 49 19 1F B0 59
//웹브라우져 송신
wSocket.send("12345678901234567890");
//서버수신데이터 len=28
88 96 EC 30 0E 7B EF DA 47 15 9A 51 62 12 88 10 7C 1E 9F 55 7C 0D 89 54 2E 19 85 44
//바이너리 전송을 시도해보았다.
function websocket_send(s,data)
{
//var data=ctx.getImageData(0, 0, 200, 200).data;
var byteArray=new Uint8Array(data);
s.send(byteArray.buffer);
}
websocket_send(wSocket,"1111");
len=39
81 85 AA 4A 85 FF E2 2F E9 93 C5 88 96 CB EE 72 A8 C8 04 3B C6 BD 8F 1E C1 AF CE 00 CD B8 8B 00 DE AE 8A 52 CA A2 9A
//머야 이거... 갈수록 태산
//wSocket.binaryType="arraybuffer";추가후
websocket_send(wSocket,"1111");
len=28
88 96 57 83 08 CE 54 69 41 A0 21 E2 64 A7 33 A3 7A AB 24 E6 7A B8 32 E7 28 AC 3E F7
len=28
88 96 2C B9 62 9C 2F 53 2B F2 5A D8 0E F5 48 99 10 F9 5F DC 10 EA 49 DD 42 FE 45 CD
len=39
function websocket_send(s,data)
{
s.send(data.buffer);
}
websocket_send(wSocket,"1111");
len=28
00CEAC24 88 96 AC 56 A8 F4 AF BC 닑촚⑭?
00CEAC2C E1 9A DA 37 C4 9D C8 76 ?.7휐?
00CEAC34 DA 91 DF 33 DA 82 C9 32 ?.3?.2
00CEAC3C 88 96 C5 22
00CEAC24 88 96 31 82 21 1E 32 68 닑1.!.2h
00CEAC2C 68 70 47 E3 4D 77 55 A2 hpG?wU.
00CEAC34 53 7B 42 E7 53 68 54 E6 S{B?hT.
00CEAC3C 01 7C 58 F6
00CEAC24 88 96 24 AF D1 6C 27 45 닑$?l'E
00CEAC2C 98 02 52 CE BD 05 40 8F ..R館.@.
00CEAC34 A3 09 57 CA A3 1A 41 CB . W假.A.
00CEAC3C F1 0E 4D DB
보낼때 마다 값이 달라진다!!!
//wSocket.binaryType="arraybuffer"; 주석처리후
00CEAC24 88 96 2A 5E A8 9E 29 B4 닑*^쯂).
00CEAC2C E1 F0 5C 3F C4 F7 4E 7E 鎖\?퀄N~
00CEAC34 DA FB 59 3B DA E8 4F 3A 拔Y;斑O:
00CEAC3C 88 FC 43 2A
00CEAC24 88 96 B0 B3 B2 93 B3 59 닑개쾽쿧
00CEAC2C FB FD C6 D2 DE FA D4 93 火팬麝?
00CEAC34 C0 F6 C3 D6 C0 E5 D5 D7 쟝최장兩
00CEAC3C 92 F1 D9 C7
wSocket.send("1111");
00CEAC24 88 96 7F 78 45 ED 7C 92 닑.xE?.
00CEAC2C 0C 83 09 19 29 84 1B 58 .. .)..X
00CEAC34 37 88 0C 1D 37 9B 1A 1C 7...7...
00CEAC3C 65 8F 16 0C
00CEAC24 88 96 42 89 CC CA 41 63 닑B됊?c
00CEAC2C 85 A4 34 E8 A0 A3 26 A9 뀮4?.&.
00CEAC34 BE AF 31 EC BE BC 27 ED 쒸1苡.'.
00CEAC3C EC A8 2B FD
void send(
in DOMString data
);
void send(
in ArrayBuffer data
);
void send(
in Blob data
);
DOMString is a UTF-16 String. As JavaScript already uses such strings, DOMString is mapped directly to a
String
.Passing null to a method or parameter accepting a DOMString typically stringifies to "null".