Results 1 to 7 of 7
  1. #1
    grahamcrackeh is offline Member
    Join Date
    Mar 2011
    Posts
    11
    Rep Power
    0

    Exclamation Simple Method Gives Me an Error

    I've been writing an OSC program using the JavaOSC library and when I call the OSCPortIn.close() method I get this error:

    Java Code:
    java.net.SocketException: socket closed
    	at java.net.PlainDatagramSocketImpl.receive0(Native Method)
    	at java.net.PlainDatagramSocketImpl.receive(Unknown Source)
    	at java.net.DatagramSocket.receive(Unknown Source)
    	at com.illposed.osc.OSCPortIn.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    If I don't use the method, I can't access the port after I've ran the program once.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Could you be calling it twice so that it is already closed on the second call?

  3. #3
    grahamcrackeh is offline Member
    Join Date
    Mar 2011
    Posts
    11
    Rep Power
    0

    Default

    I'm only calling it once in the constructor for my OscIn class. It listens for thirty seconds and then calls close() and gives me an error

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,830
    Rep Power
    19

    Default

    That's not even slightly similar.
    That's a compilation error, not a runtime execution exception.

    So maybe you should create your own thread for this problem rather than hijack someone elses.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  6. #6
    grahamcrackeh is offline Member
    Join Date
    Mar 2011
    Posts
    11
    Rep Power
    0

    Default

    Could anyone help me?

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    when I call the OSCPortIn.close() method
    at java.net.DatagramSocket.receive(Unknown Source)
    at com.illposed.osc.OSCPortIn.run(Unknown Source)
    Strange that stack trace doesn't show the close() method that you say you are calling. The trace shows the receive() method being called with a closed socket.
    Did you post the FULL stack trace?

Similar Threads

  1. 30 line simple gui, simple error, need help
    By cc11rocks in forum New To Java
    Replies: 6
    Last Post: 02-05-2011, 08:33 PM
  2. Simple calculation method problem.
    By carman12 in forum New To Java
    Replies: 11
    Last Post: 12-29-2010, 01:56 AM
  3. No Such Method Error - simple
    By n00b in forum New To Java
    Replies: 9
    Last Post: 05-04-2010, 04:05 PM
  4. Replies: 2
    Last Post: 05-04-2008, 05:27 PM
  5. Simple Method Question
    By Froz3n777 in forum New To Java
    Replies: 2
    Last Post: 02-13-2008, 02:39 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •