MCPcopy Index your code
hub / github.com/Q16G/memory-shell / sendResponse

Method sendResponse

src/main/java/org/example/Socks5Server.java:253–263  ·  view source on GitHub ↗
(SocketChannel channel, byte status)

Source from the content-addressed store, hash-verified

251 }
252
253 private void sendResponse(SocketChannel channel, byte status) throws IOException {
254 ByteBuffer response = ByteBuffer.allocate(10);
255 response.put(SOCKS_VERSION);
256 response.put(status);
257 response.put((byte) 0x00); // 保留字节
258 response.put(IPV4_ADDRESS);
259 response.put(new byte[]{0, 0, 0, 0}); // 绑定地址
260 response.putShort((short) 0); // 绑定端口
261 response.flip();
262 writeFully(channel, response);
263 }
264
265 private void readFully(SocketChannel channel, ByteBuffer buffer) throws IOException {
266 while (buffer.hasRemaining()) {

Callers 1

Calls 1

writeFullyMethod · 0.95

Tested by

no test coverage detected