zhoujian2030 / jdiameter

Automatically exported from code.google.com/p/jdiameter
0 stars 0 forks source link

Problem with send messages using java.nio.SocketChannel in JDiameter #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have two computers with windows 7
2. I wrote simple server and client application based on examples (attached 
sources in achrive)
3. Start wireshark, server and client

What is the expected output? What do you see instead?
Client must send 10000 ccr, but in wireshark i see only 200-300 ccr, other 
message raised timeouts. If in class TCPTransportClient replace line :
  rc = socketChannel.write(bytes);
to
  while(bytes.hasRemaining())
     rc = socketChannel.write(bytes);
client was sended all 10000 ccr, but very slow.

What version of the product are you using? On what operating system?
Windows 7, client uses lastest sources from master on github, server uses 
1.5.0.FINAL

Please provide any additional information below.
I tested client on other diameter server wroted on c++, client send ~7000 ccr, 
but this server hosted on debian

Original issue reported on code.google.com by elvistea@mail.ru on 18 Mar 2014 at 10:51

Attachments:

GoogleCodeExporter commented 9 years ago
I increase receiving and sending socket buffers to 1mb in 
TcpTransportClient.intialize:
  socketChannel.socket().setReceiveBufferSize(size);
  socketChannel.socket().setSendBufferSize(size);
And add this code to sendMessage:
  rc = socketChannel.write(bytes);
  if (rc == 0)
    while (bytes.hasRemaining()) {
      Thread.sleep(10l);
      rc = socketChannel.write(bytes);
   }

It's work fine with diameter server on c++ on debian, but on jdiameter server 
problem not solved.

Original comment by elvistea@mail.ru on 20 Mar 2014 at 8:04

GoogleCodeExporter commented 9 years ago
This seems to be related to the same issue reported in issue 41. Please give 
the proposed workaround/solution a try and see if it helps.

Original comment by brainslog on 8 Jul 2014 at 1:36