• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

sending an array through a socket

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to do a pong game to play in network. Two applications one client an another server. The server commands the ball and send the coordinates of the ball and the position of the racquet to the client in an array by mean of an array. And the problem is that the array values don't refresh, the values are the same always. I use the method writeObject(int[] m) and readObject()

I try to use ArrayList instead of an array, and Integer, but does't change the result. Aswell try to use a new class Message with variable members the coordinates of the ball and racquet, but is the same problem
 
Bartender
Posts: 5914
57
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
 
Marshal
Posts: 64699
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
Sheriff
Posts: 6039
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Pedro Sosa!

As to sharing code, you have several options.  One is to create an SSCCE (that's a link), but this may be difficult with a Client/Server application.  The other to share a GitHub url, but this may provide too much information.

So, as a third option, try to share just the class that you think is causing the problem, or even a snippet of the class, but make sure there is enough code to understand what is going on.
 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code is available in:

https://github.com/psosmol/javaArraySocket

Thanks
 
Knute Snortum
Sheriff
Posts: 6039
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You only uploaded a zip file, not the actual Java source files.  Most people aren't going to take the time to unzip the files.  Try uploading the sources to GitHub instead.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!