Gustlik 123
Gustlik 123

Reputation: 1

Kryonet server not receiving a registered class

I'm making a simple chat using kryonet. I've had no problems sending messages. But for some reason the server just doesn't respond when i send it an attachment. I'm trying to send a file(converted to buffer array) as well as some info in an attachment class.

when i send over the message the server receives it normally message source:

public class Message {

private String username;
private String message;
private int ID;

public Message(){

}

public Message(String name, String message, int ID){
    this.username = name;
    this.message = message;
    this.ID = ID;
}

public String getUsername() {
    return username;
}

public int getID() {
    return ID;
}

public String getMessage(){
    return message;
}

}

however when i send over an attachment the server doesn't receive anything attachment source:

public class Attachment{

private String username;
private int ID;
private byte[] bytes;
private String filename;

public Attachment() {

}

public Attachment(byte[] bytes, String filename ,String username, int ID) {
    this.bytes = bytes;
    this.filename = filename;
    this.username = username;
    this.ID = ID;
}


public String getFilename(){
    return filename;
}

public byte[] getBytes(){
    return bytes;
}

public String getUsername() {
    return username;
}

public int getID() {
    return ID;
}

}

No errors are thrown. if anyone's got an idea on what the issue is please let me know.

Upvotes: 0

Views: 60

Answers (1)

Gustlik 123
Gustlik 123

Reputation: 1

Solved! I never found out what it was, i just rewrote the Attachment file and it worked.

Upvotes: 0

Related Questions