Home > Back-end >  Java socket send byte array can be successful netty framework
Java socket send byte array can be successful netty framework

Time:03-01

Only server-side programming, the client is a hardware device, through the Java socket send hexadecimal array can be successful, hardware devices can have action, and sent by netty framework directive is not line, equipment without action,

.

Byte [] arrbyte=new byte [8].

Arrbyte [0]=0 xfe (byte);

.

OutputStream socketWriter=socket. GetOutputStream ();

SocketWriter. Write (arrbyte);

SocketWriter. Flush ();

The above operation is possible,

Not by netty operation

CTX. WriteAndFlush (arrbyte);

Beg to solve, thank you master

CodePudding user response:

Use netty bytebuf right the code posted some more

CodePudding user response:

CTX. WriteAndFlush (Unpooled. CopiedBuffer (arrbyte));

CodePudding user response:

NIO non-blocking one-way communication with the TCP client and server

http://www.verejava.com/? Id=17508415963845

CodePudding user response:

references a gun on the second floor do SAO, soul response:
CTX. WriteAndFlush (Unpooled. CopiedBuffer (arrbyte));

Thanks for brother
  • Related