| | |
| | | import android.util.Log; |
| | | |
| | | import com.example.agvcontroller.Item; |
| | | import com.example.agvcontroller.protocol.AgvAction; |
| | | |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void sendMessageToClient(String clientId, AgvAction<?> action) { |
| | | |
| | | |
| | | |
| | | Channel channel = channelMap.get(clientId); |
| | | if (channel != null && channel.isActive()) { |
| | | |
| | | channel.writeAndFlush(action); |
| | | } else { |
| | | Log.d(TAG, "Client " + clientId + " is not connected"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { |
| | | cause.printStackTrace(); |