Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange traffic in java sockets

I'am investigating strange problem. I'am using java Sockets for IPC. And i'am worrying about strange traffic. When i use c# and transfer strings via StreamWriter it is ok:

enter image description here

But when i use java and ObjectOutputStream\ObjectInputStream it is very strange: https://i.sstatic.net/7bWSt.png

First column is inbound traffic and second is outbound.

It is simple code:

ObjectOutputStream oos = ObjectOutputStream(clientScoket.getOutputStream())
oos.writeObject(someCustomObject);

on another side:

ObjectInputStream ois = ObjectInputStream(clientSocket.getInputStream());
SomeCustomObject sco = oos.readObject();

How inbound traffic can be unequal to outbound? Anyone?

like image 555
AKiNO Avatar asked Jul 03 '26 21:07

AKiNO


1 Answers

It's some sort of problem in sniffing loopback traffic under Windows. I tried and no tools found anything (Wireshark and WinPCap cannot loopback). When you use simple streams and just write some bytes it is okay. The problem appears only with ObjectIputStream.

like image 188
AKiNO Avatar answered Jul 06 '26 10:07

AKiNO



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!