Jump to content

java.net.SocketException: socket closed


Niuva

Recommended Posts

Heya folks!

 

I've been fiddling around and trying to get my server functional, but I've run to a problem that I just cannot figure out - don't know if it's a problem at my end, or if the early state of the alpha multiplayer is to blame.

Anyway, here goes:

 

My ports are open (16261-16326, both TCP and UDP )  and even tried setting the server outside the DMZ, with disabled firewall and Antivirus(Not recommended, but only for troubleshooting). People can connect, but after a short time interval new areas stop to load for them, locking the player down to a small limited area, with black borders around it. Zombies still are active and everything in the limited playable area is functional. Manually disconnecting or attempting to quit at this point crashes the player client. Such issue does not appear on other servers for me, only on mine so far.

 

Here are the excerpts from the consoles when the 'incident' happens, both server and client.

 

Server Console:

java.net.BindException: Address already in use: JVM_Bind        at java.net.DualStackPlainSocketImpl.bind0(Native Method)        at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)Loading cell: 166, 143 (38, 33)        at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)        at java.net.ServerSocket.bind(ServerSocket.java:376)        at java.net.ServerSocket.<init>(ServerSocket.java:237)        at java.net.ServerSocket.<init>(ServerSocket.java:128)        at zombie.network.PlayerDownloadServer$1.run(PlayerDownloadServer.java:349)Exception in thread "Thread-74" java.lang.NullPointerException        at zombie.network.PlayerDownloadServer$1.run(PlayerDownloadServer.java:373)

Client Console:

Player Connect received for player Niuva id 0 (me)INDEX MISSPLACED -1 size 3INDEX MISSPLACED -1 size 3java.net.SocketException: socket closed	at java.net.SocketInputStream.socketRead0(Native Method)	at java.net.SocketInputStream.read(SocketInputStream.java:150)	at java.net.SocketInputStream.read(SocketInputStream.java:121)	at java.net.SocketInputStream.read(SocketInputStream.java:203)	at zombie.network.GameFileClient.DoFileTransferZip(GameFileClient.java:497)	at zombie.network.GameFileClient.access$000(GameFileClient.java:22)	at zombie.network.GameFileClient$1.run(GameFileClient.java:233)receiveObjectChange AddRandomDamageFromZombiejava.net.SocketException: socket closed	at java.net.SocketInputStream.socketRead0(Native Method)	at java.net.SocketInputStream.read(SocketInputStream.java:150)	at java.net.SocketInputStream.read(SocketInputStream.java:121)	at java.net.SocketInputStream.read(SocketInputStream.java:203)	at zombie.network.GameFileClient.DoFileTransferZip(GameFileClient.java:497)	at zombie.network.GameFileClient.access$000(GameFileClient.java:22)	at zombie.network.GameFileClient$1.run(GameFileClient.java:233)java.net.SocketException: socket closed	at java.net.SocketInputStream.socketRead0(Native Method)	at java.net.SocketInputStream.read(SocketInputStream.java:150)	at java.net.SocketInputStream.read(SocketInputStream.java:121)	at java.net.SocketInputStream.read(SocketInputStream.java:203)	at zombie.network.GameFileClient.DoFileTransferZip(GameFileClient.java:497)	at zombie.network.GameFileClient.access$000(GameFileClient.java:22)	at zombie.network.GameFileClient$1.run(GameFileClient.java:233)

When the client tries to disconnect the server / exit the game, the client crashes.

Upon relaunching the game and attempting to reconnect, the client starts looping the following message in the console, not being able to get in.

timeout downloading zip, I'll keep waiting forever

And this is what happens server side.

ID_NEW_INCOMING_CONNECTIONid=0 guid=711568742487824329User Niuva is trying to connect.Connected new client Niuva ID # 0 and assigned DL port 16262Shared zombie descriptor packet size is 64KBMetaGrid packet size is 33KBjava.net.BindException: Address already in use: JVM_Bind        at java.net.DualStackPlainSocketImpl.bind0(Native Method)        at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)        at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)        at java.net.ServerSocket.bind(ServerSocket.java:376)        at java.net.ServerSocket.<init>(ServerSocket.java:237)        at java.net.ServerSocket.<init>(ServerSocket.java:128)        at zombie.network.PlayerDownloadServer$1.run(PlayerDownloadServer.java:349)Exception in thread "Thread-107" java.lang.NullPointerException        at zombie.network.PlayerDownloadServer$1.run(PlayerDownloadServer.java:373)

I'm out of ideas and no solution in sight. So my only option now is to turn to the official boards to seek assistance from the developers and more experienced people in the community. 

 

Cheers. :)

Link to comment
Share on other sites

This happens even with only one player.

I haven't actually tweaked anything ram related, it is as is; out of the box. I haven't seen this mentioned in any of the documentations on the forums before?

 

Edit:

Apparently it is set to 2gigs.

 

Edit 2:

Now I've set it to 12 gigs; still occurring.

Edited by Niuva
Link to comment
Share on other sites

This happens even with only one player.

I haven't actually tweaked anything ram related, it is as is; out of the box. I haven't seen this mentioned in any of the documentations on the forums before?

 

Edit:

Apparently it is set to 2gigs.

 

It points to either something preventing the streaming on the servers side, or blocking of incoming information from the server on the players computer. If it's affecting more than one people, then I would imagine it is something on the server/network causing it. Socketexception is what is tipping me off to it. Something is slowing it down.

Link to comment
Share on other sites

ive come across this one as well, was able to reproduce this error yesterday by running a local server, log on with admin and just run around at full speed, at some point you'll get it that way eventually.

5e60d12830e365216725a33de67c54ed.png

sometimes, but way more rarely this one pops up too:

d0688f36b034e15a0e1623a9e165154b.png

latest IWBUMS im using, no mods loaded.

Link to comment
Share on other sites

ive come across this one as well, was able to reproduce this error yesterday by running a local server, log on with admin and just run around at full speed, at some point you'll get it that way eventually.

5e60d12830e365216725a33de67c54ed.png

sometimes, but way more rarely this one pops up too:

d0688f36b034e15a0e1623a9e165154b.png

latest IWBUMS im using, no mods loaded.

 

I assume your dedicated linux server never produced this?

Link to comment
Share on other sites

According to Steam - no.

Oddly enough, it's been stable for at least an hour now. People have been connecting an playing on it. 
Even tho I changed the ram allocation to 12 gigs, it kept crashing - but after a few crashes it seems to .. work.

Neatly even shows up in the server browser and all. :)

 

Odd.

Link to comment
Share on other sites

According to Steam - no.

Oddly enough, it's been stable for at least an hour now. People have been connecting an playing on it. 

Even tho I changed the ram allocation to 12 gigs, it kept crashing - but after a few crashes it seems to .. work.

Neatly even shows up in the server browser and all. :)

 

Odd.

 

Turbotutone, EG and myself did some testing, lodged it as a bug that does seem to pop up occasionally. Can't completely narrow it down but hopefully it's something that will get sorted or at the very least get some more information on it.

Link to comment
Share on other sites

Ah, that is good to hear.

My server has been up for around 14 hours now; people aren't reporting such issues occurring anymore.

I guess it fixed it self, even tho I didn't really do anything?

Link to comment
Share on other sites

  • 2 years later...

A "java.net.SocketException: Socket closed" exception can happen in various situations. Either the server side closed the connection like nKn suggested, or the client side (your app) closed the connection. Even if you are not aware of doing it, there may be some less obvious code that may lead to closing the socket, like Thread.interrupt() or ExecutorService.shutdownNow().

 

Check this ..... simple socket programming in java

 

Crow

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...