com.iteaj.iot.client.udp.UdpClientMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iot-client Show documentation
Show all versions of iot-client Show documentation
基于netty的tcp, http, udp等协议的客户端
The newest version!
package com.iteaj.iot.client.udp;
import com.iteaj.iot.client.ClientMessage;
import com.iteaj.iot.udp.UdpMessage;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
/**
* 基于Udp协议的客户端报文
*/
public abstract class UdpClientMessage extends ClientMessage implements UdpMessage {
private InetSocketAddress sender;
private InetSocketAddress recipient;
public UdpClientMessage(byte[] message) {
super(message);
}
public UdpClientMessage(MessageHead head) {
super(head);
}
public UdpClientMessage(MessageHead head, MessageBody body) {
super(head, body);
}
@Override
public InetSocketAddress getSender() {
return this.sender;
}
@Override
public UdpMessage setSender(InetSocketAddress sender) {
this.sender = sender;
return this;
}
@Override
public SocketAddress getRemote() {
return this.getRecipient();
}
@Override
public void setRemote(SocketAddress remote) {
this.setRecipient((InetSocketAddress) remote);
}
@Override
public InetSocketAddress getRecipient() {
return this.recipient;
}
@Override
public UdpMessage setRecipient(InetSocketAddress recipient) {
this.recipient = recipient;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy