See here.
3 replies to this topic
#1
Posted 08 December 2011 - 02:09 AM
|
|
|
#2
Posted 08 December 2011 - 02:35 AM
Quote
[TABLE]
[TR]
[TD="class: votecell"][/TD]
[TD="class: postcell"] I'm currently using a Java implementation of the Reliable UDP protocol, found [here][1]. The project has absolutely no tutorials so I have found it really hard to identify problems.
I have set up a client and server. The server runs on localhost:1234 and the client runs on localhost:1235. The server is first established, and loops listening for connections.
I then have set it to send a packet to the server. When a packet is sent, the server calls handlePacket() -
[/TD]
[/TR]
[/TABLE]
[TR]
[TD="class: votecell"][/TD]
[TD="class: postcell"] I'm currently using a Java implementation of the Reliable UDP protocol, found [here][1]. The project has absolutely no tutorials so I have found it really hard to identify problems.
I have set up a client and server. The server runs on localhost:1234 and the client runs on localhost:1235. The server is first established, and loops listening for connections.
I then have set it to send a packet to the server. When a packet is sent, the server calls handlePacket() -
DataInputStream i = new DataInputStream(client.getSocket().getInputStream());
short packetID = i.readShort();
i = null;
switch(packetID){
case 3:
Packeta packeta = new Packeta(client);
break;
}
} catch (IOException e) {
e.printStackTrace();
}
I'm currently using a debugging with a small dummy class called Packeta. When the constructor is called, it reads from a stream and the logs to the console. However, always when constructing, it hangs for 10 seconds, before producing the error - java.net.SocketException: Socket is closed ....
at lessur.engine.net.packets.Packeta.(Packeta.java:15)
public Packeta(LessurConnectedNode c) {
super((short)3, c);
try {
/*LINE 15*/ Logger.getLogger("adsfas").info("X was "+c.getSocket().getInputStream().read());
} catch (IOException e) {
e.printStackTrace();
}
}
It has something todo with the input streams. I don't know what is wrong, but from reading other threads, it might be todo with having multiple inputstreams. I'm lost on this, please help.[/TD]
[/TR]
[/TABLE]
- Server isn't running or has stopped running.
- Server has closed its socket or never opened it.
- LesserConnectedNode contains a bad reference to the Server's socket.
#3
Posted 08 December 2011 - 03:18 AM
The problem was, I was passing the server to the socket listener, before the socket was fully initialized. FIXED!
#4
Posted 08 December 2011 - 08:59 PM
Its happening again
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









