• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

inputStream freezes

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I have problem with my aplication. You must run it with argument 0(for server) and 1(for client).



I don't know why but it freezes on the ObjectInputStream constructors with Cipher streams. When I don't use
Cipher stream it works. When i have only ois = new ObjectInputStream(new CipherInputStream(s.getInputStream(), cipher2)); in the server and ous = new ObjectOutputStream(new CipherOutputStream(s.getOutputStream(), cipher2)); in the client it works too. What i'm doing wrong?
Thanks for your help and sorry for my english.
greetings for you all.
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!!

I didn't get one thing in your code.You have used:
ObjectOutputStream ous = new ObjectOutputStream(s.getOutputStream());

and after that you have again allocated it with:
ous = new ObjectOutputStream(new CipherOutputStream(s.getOutputStream(), cipher));

So, I didn't get this part. when you have already obtained a stream ous, then wy are you not using this stream and re-intializing it.
This must not produce any result.
Anyways, what's the output you are getting?
I think error is with this stream only.
First have a socket -> then obtain a stream -> use it to read/write.
Hope it helped.
reply
    Bookmark Topic Watch Topic
  • New Topic