package org.wcs.plugin.tcp.model;

import lombok.*;
import org.wcs.plugin.tcp.enums.SocketStatusEnum;

import java.net.Socket;
import java.time.LocalDateTime;

/**
 * Socket 数据项
 */
@Getter
@Setter
@ToString
@Builder
public class SocketDataItem {

    /**
     * SocketId
     */
    private String socketId;

    /**
         * Socket标记
     */
    private String socketTag;

    /**
     * Socket IP
     */
    private String socketIp;

    /**
     * Socket 端口
     */
    private int socketPort;

    /**
     * 心跳包内容
     */
    private String heartBeatString;

    /**
     * Socket
     */
    private Socket socket;

    /**
     * 自动重连
     */
    @Builder.Default
    private boolean autoReconnect = true;

    /**
     * 接收字节长度
     */
    @Builder.Default
    private int receiveBytesLength = 1024;

    /**
     * Socket 状态
     */
    private SocketStatusEnum socketStatus;

    /**
     * 最后收到消息时间
     */
    private LocalDateTime lastReceiveMessageTime;

    /**
     * 手动断开连接 ---- 手动断开这里是true
     */
    private boolean userDisConnected;


}
