[solved] Hanging networking code? (Client I/O Init)

Hey JGO, In my networking library it seems to be taking forever to initialize the clients input stream?
(Attempting to implement UDP to work with my TCP packet system)

The server initializes the clients I/O almost instantly, but client-sided it hangs for 2,200ms+?

NOTE: Server/Client I/O are initialized the same way, the client initialization just hangs for a few seconds…

Console output:


GNetClient -> (1/3) Streams initialized in 0ms.
GNetClient -> (2/3) Streams initialized in 0ms.
GNetClient -> (2/3) Streams initialized in 2251ms.

Initialization code:


// Stage 1
bos = new BufferedOutputStream(serverSocket.getOutputStream());
bis = new BufferedInputStream(serverSocket.getInputStream());
			
// Stage 2
outputStream = new ObjectOutputStream(bos);
outputStream.flush();
			
// Stage 3
inputStream = new ObjectInputStream(bis); // OCCURS ON THIS LINE

Does anyone know why this is happening?

  • Thanks, if you need more info please ask :slight_smile: