• 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

How to Parse Double from a client within server using DataInputStream

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a client, and a server.

i run the server and the output is,

Creating Server Socket 5095 . . .
SUCCESS!!!
in while loop
Waiting for connection.

then i run the client and the output is,

Creating Client Socket
SUCCESS!!!
initializing variables
variables flushed
initializing input
java.io.EOFException
at java.io.DataInputStream.readFully(Unknown Source)
at java.io.DataInputStream.readLong(Unknown Source)
at java.io.DataInputStream.readDouble(Unknown Source)
at Client.runClient(Client.java:38)
at Client.main(Client.java:51)

I would like to initialize some doubles in the client, and send them to the server, where they will be parsed and manipulated, with the result then being sent back to the client.

I believe the client crashes when I try to write the double to the OutputStream.
What Am I doing wrong?

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ricardo Santiago wrote:What Am I doing wrong?



What makes you think you are doing something wrong? Do you have some kind of a problem with the process you described? If so, what is it?
 
Ricardo Santiago
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Ricardo Santiago wrote:What Am I doing wrong?



What makes you think you are doing something wrong? Do you have some kind of a problem with the process you described? If so, what is it?



The client crashes when attempting to write the double to the outputStream.
 
Ricardo Santiago
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
error resolved by making this change to server application

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic