-
Notifications
You must be signed in to change notification settings - Fork 0
Packet Responses
gcflames5 edited this page Aug 24, 2014
·
2 revisions
When creating a new Packet, you have the option to indicate that the packet is a response to another packet through setResponse(Packet packet). The AutoResponder class allows you to perform an action when you receive a packet in response to the indicated packet.
Example:
ResponseUtil.getDefaultResponder().onResponse(sentPacket, new Response() {
@Override
public void run() {
Packet receivedPacket = packet;
Connection connection = event.getConnection();
//Handle response
}
});The packet and event variables are set for you in Response automagically.
Basic IO
Basic Client
Basic Server
Authenticated IO
Authenticated Client
Authenticated Server
Mesh
Mesh Network
Authenticated Mesh
Packets
Creating Packets
Sending Packets
Listening for Packets
Automatic Handlers
Response Handlers
UPnP
Port Forwarding