• 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

confused on why socket is closed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am programming a client/server applicn on a single physical machine. The client sends a packet to the server for processing, with the IP addy they are both running on.
clientSocket.send(sendPacket);
Everything works fine upto this point. But I get a crash when recieving the results from the server.
clientSocket.receive(receivePacket);
This is the error displayed by the compiler:
java.net.SocketException: socket closed
at java.net.PlainDatagramSocketImpl.receive(Native Method)
at java.net.DatagramSocket.receive(DatagramSocket.java:392)
at WCclient.main(WCclient.java:106)
Exception in thread "main"
Any help on this will be highly appreciated.
reply
    Bookmark Topic Watch Topic
  • New Topic