Thread: SocketException:BrokenPipe :(

Results 1 to 8 of 8
  1. #1 SocketException:BrokenPipe :( 
    Registered Member
    Join Date
    Feb 2009
    Posts
    582
    Thanks given
    28
    Thanks received
    14
    Rep Power
    26
    Ok i set up my server on centos and when i run it, it works fine untill someone logs out. it wont save the file....


    i get this..

    Code:
    java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(native method)
    at java.net.SocketOutputStream.socketWrite(socketOutputStream).java:109
    at java.net.SocketoutputStream.write(socketOutputStream.java:153)
    at client.parseOutgoingPackets(client.java:9382)
    at client.packetProcess(client.java:17149)
    at client.packetSending(client.java:17141)
    at playerhander.process(playerhandler.java:138)
    at server.main(server.java:51)
    might have spelled a few words wrong cuz i cant copy over from the linux vps
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Feb 2009
    Posts
    582
    Thanks given
    28
    Thanks received
    14
    Rep Power
    26
    nobody knows...?
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Feb 2008
    Posts
    384
    Thanks given
    30
    Thanks received
    26
    Rep Power
    0
    Well from what I can come up with when I google "java.net.SocketException: Broken pipe"

    Most people said something similar to what this guy said "This happens when you write to a TCP connection that has already been closed by the reading end. Depending on your application, you would either treat it as an application protocol error or ignore it and give up. In either case the socket is almost certainly dead and must be closed, and the client session abandoned."
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Jan 2008
    Age
    28
    Posts
    1,380
    Thanks given
    76
    Thanks received
    384
    Rep Power
    962
    Client.java line 9382 post it
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2009
    Posts
    582
    Thanks given
    28
    Thanks received
    14
    Rep Power
    26
    line 9382
    out.write(buffer, offset, numBytesInBuffer);
    whole method
    Code:
    	public void parseOutgoingPackets() {
    		// relays any data currently in the buffer
    		if(writePtr != readPtr) {
    			offset = readPtr;
    			if(writePtr >= readPtr) numBytesInBuffer = writePtr - readPtr;
    			else numBytesInBuffer = bufferSize - readPtr;
    			if(numBytesInBuffer > 0) {
    				try {
    					// Thread.sleep(3000);		// artificial lag for testing purposes
    	                out.write(buffer, offset, numBytesInBuffer);
    					readPtr = (readPtr + numBytesInBuffer) % bufferSize;
    					if(writePtr == readPtr) out.flush();
    				} catch(java.lang.Exception __ex) {
    					misc.println("BlakeScape Server: Exception!");
    					__ex.printStackTrace(); 
    					disconnected = true;
    				}
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Feb 2008
    Posts
    384
    Thanks given
    30
    Thanks received
    26
    Rep Power
    0
    You are trying to write to the socket after you have closed it.... So put a check in somewhere to make sure that when a player logs out you stop the writing to the socket... if that made any sense
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Feb 2009
    Posts
    582
    Thanks given
    28
    Thanks received
    14
    Rep Power
    26
    Quote Originally Posted by billygotshot View Post
    You are trying to write to the socket after you have closed it.... So put a check in somewhere to make sure that when a player logs out you stop the writing to the socket... if that made any sense
    it kinda did but um dam i need someone pro to explain it better and hep me
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Feb 2009
    Posts
    582
    Thanks given
    28
    Thanks received
    14
    Rep Power
    26
    plz i really need this, btw the server works on windows perfectly just on linux it doesnt...
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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