Questions tagged [kryonet]

TCP and UDP client/server library for Java

KryoNet is a Java library that provides a clean and simple API for efficient TCP and UDP client/server network communication using NIO. It runs on both the desktop and on Android. It is very efficient, so is especially good for games. KryoNet can also be useful for inter-process communication.

KryoNet makes the assumptions that it will only be used for client/server architectures and that KryoNet will be used on both sides of the network.

The following resources are available for KryoNet:

151 questions
3
votes
1 answer

Java Game Networking with Kryonet: Bare-bones packet transfering

I'm using Opengl and Jbox2d to write a real-time 2d game in Java. I want to start coding the networking components. Although it uses box2d, my game is very small and I want to create a bare-bones architecture using the Kryonet library. The program…
bigcodeszzer
  • 916
  • 1
  • 8
  • 27
3
votes
4 answers

What does `instanceof` check to determine object types?

I'm using kryonet to send objects back and forth from a server and client. There is a listener that is run whenever an object has been received. The only way it seems to determine the object's instance is by using: if(object instanceof…
vedi0boy
  • 1,030
  • 4
  • 11
  • 32
3
votes
1 answer

P2P message sending using NAT punch-through in Android

I try to send a message from one phone to another using Kryonet (that uses socket communication) and I intend to use NAT punch-through by storing the public address of the clients. The following code is used: public class MainActivity extends…
Nestor
  • 8,194
  • 7
  • 77
  • 156
3
votes
1 answer

How to register an Enum class in Kryonet?

I am trying to register my classes in order to send information over a network. I need to register an Enum class that looks like this: public enum Fort{ NOFORT("No Fort", 0, 0), TOWER("Tower", 1, 1), KEEP("Keep", 2, 2), CASTLE("Castle", 3, 3),…
Sarah
  • 2,713
  • 13
  • 31
  • 45
3
votes
1 answer

How to send objects over a network using Kryonet?

I am new to networking, and I am trying to network a board game that I have created using java.A friend of mine pointed me towards the Kryonet library. So far, it's great. I don't have to deal with sockets! The problem I'm coming across is sending…
Sarah
  • 2,713
  • 13
  • 31
  • 45
3
votes
2 answers

Java Kryonet servers, client not receiving server response

I am trying to teach myself some networking in Java using the Kryonet library. The following code is almost identical to the code in the kyronet tutorial. https://code.google.com/p/kryonet/#Running_a_server The client is successfully sending the…
DanMc
  • 848
  • 5
  • 15
  • 26
3
votes
1 answer

libgdx & kryonet: threads

I try to develop a game for Android platform, using Libgdx library. For network, I use the Kryonet library. I want to change screen when I'm sure that my application is connected to my server. The network part seems work but I have a problem with…
Jonathan
  • 35
  • 1
  • 5
2
votes
3 answers

Java Kryonet [Class is not registered Exception ]

I found this API called Kryonet. Well, i tried to implement the example provided in the project page. However, it wasn't successful. Server code: public class KryoTest { public KryoTest() throws IOException { Server server = new Server(); …
nebula
  • 3,932
  • 13
  • 53
  • 82
2
votes
1 answer

libgdx throws error on spritebatch creation

If I change the screen like this it works. button.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { someclass.setScreen(someclass.getGameScreen()); …
sayon
  • 43
  • 1
  • 5
2
votes
1 answer

Message not being received by kryonet listener?

So I'm having a problem testing my networking, there's a lot of code below but this is as small as I could make an example. The problem I'm having is that it seems the listener I'm registering with the server and client never gets called when when I…
Renari
  • 822
  • 7
  • 16
  • 32
2
votes
0 answers

LibGDX + Kryonet, will it work on iOS?

I'm creating a multiplayer mobile game using LibGDX library. For networking I use Kryonet which is written in Java. As I read (and tried), Kryonet works well on Android devices but I have no emulator/device to test anything on iOS. Did anyone tried…
user6367252
2
votes
1 answer

kryonet server crashing when receiving an object

I have a problem with Kryonet server crashing after receiving an object from client. Server code: package com.qookie.miner_server; import java.io.IOException; import com.esotericsoftware.kryo.Kryo; import com.esotericsoftware.kryonet.Server; import…
user5511276
2
votes
0 answers

Connecting Socket.IO and Kryonet, connected, but timed out during TCP registration

I have a nodeJS server setup to accept socket connections, this seems to work fine with my web applications. Now I'm trying to setup the same server to accept socket connections from Kryonet library on Android, iOS(Though RoboVM) & Desktop. Node…
Oliver Dixon
  • 7,012
  • 5
  • 61
  • 95
2
votes
0 answers

Kryonet MiniLog doesn't show anything

I am using Kryonet 2.21 on Windows 8 by using JetBrains IntelliJ IDEA 14. Here is my Problem: Recently I tried to write a Server Application with Kryonet, but no matter which Log-Level I set, the Log wont show anything... I hope somebody gets my…
Malwani
  • 21
  • 2
2
votes
3 answers

Kryonet Exception when casting received Object (Bug?)

I have this small piece of code in my class which extends Listener: @Override public void received(Connection connection, Object object) { Packet packet = (Packet) object; server.addPacket(new ClientPacket(connection.getID(),…
Xkynar
  • 935
  • 1
  • 10
  • 31
1
2
3
10 11