• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

How to increase the buffer size of the stream  RSS feed

 
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am developing a secure chat-server, in which i have to send rsa keys across client and server. However, when i try to send a key, i only receive part of the key on the other side. I feel the problem is because of the small buffer size. My key is of 1024 bit long. It is a RSA public key.

After googling, i came across two functions in the socket class:

socket.setReceiveBufferSize() and socket.setSendBufferSize().

Even after setting the buffer size, i am getting the same result.

Where am i going wrong?

 
Sheriff
Posts: 21423
94
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the small pieces of code you use to send and receive the key?
 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

That problem is solved. What went wrong was that i was using BufferedReader and PrintWriter to read and write to stream. I changed it to ObjectInputStream and ObjectOutputStream.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!