This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Parse Double from a client within server using DataInputStream  RSS feed

 
Ricardo Santiago
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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?

 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
error resolved by making this change to server application

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