Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I/O Streams: Object not reconstructing on client side  RSS feed

 
Shyam Prasad Murarka
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Readers,
I am facing a very strange problem and am at my wit's end. I will not post the entire code. Instead I will try my best to explain the problem.
I have a Server and Client. I need to constantly send Objects between them. These objects are of type:
  • LeagueTable
  • TeamRecord
  • MatchResult


  • I send an object of LeagueTable to the client. The object is sent properly.
    I try sending it a second time. But something goes wrong. I check the information contained in the object just before sending it. Its there. But, when I reconstruct the object on the client side, the object does not hold the information anymore! All data is initialized to zero. I really can't understand why this is happening. Because, it works the first time!

    I try this with the other two objects, and it works with them, no matter how many times I do it.

    If anyone has any suggestions, I would be grateful.
     
    Shyam Prasad Murarka
    Ranch Hand
    Posts: 209
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Dear Readers,
    I just tried out another thing. I sent it a second time and it worked. I guese that's not the problem. I try sending it from the createTable() method and it works. But, if I try sending it from the addTeam() method, dosen't work.



    By the way, my Streams are constructed this way:
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!