use of im.actor.core.network.mtp.entity.ProtoStruct in project actor-platform by actorapp.
the class AuthKeyActor method goToState.
private void goToState(ActorState state) {
currentState = state;
if (connection != null) {
try {
ProtoStruct struct = currentState.sendStartMessage();
byte[] data = new ProtoPackage(0, 0, new ProtoMessage(0, struct.toByteArray())).toByteArray();
connection.post(data, 0, data.length);
} catch (IOException e) {
e.printStackTrace();
}
}
}
use of im.actor.core.network.mtp.entity.ProtoStruct in project actor-platform by actorapp.
the class AuthKeyActor method onConnectionStarted.
//
// Message Processing
//
private void onConnectionStarted() {
try {
if (currentState == null) {
throw new IOException();
}
ProtoStruct struct = currentState.sendStartMessage();
byte[] data = new ProtoPackage(0, 0, new ProtoMessage(0, struct.toByteArray())).toByteArray();
connection.post(data, 0, data.length);
} catch (Exception e) {
e.printStackTrace();
crashConnection();
}
}
Aggregations