Skip to content

Tag: tcp

Socket won’t send data after blocking queue .take()

Edit: I’ve found the problem ( see answer below ) I’m trying to write an Android application to send data to a running termux instance via TCP. In termux, I have netcat listening for incoming TCP connections and printing data to stdout using the command nc -l localhost 8080. In my android app, I h…

While loop doesn’t exit after file download

I’ve got the following code to download a file being transmitted over TCP: upload code: The upload exits its loop fine. Once all the bytes have been processed (they are always processed successfully, however the loop is never exited), the file is created, without a single issue, but, the loop doesn&#821…

Netty writeAndFlush() incomplete

My tcp client request netty server, and netty server use writeAndFlush() return 393718 bytes. But the client only receive 262142 bytes. I use “tcpdump -A” to apturing packets, less than 393718 too. So I think the properble is in netty writeAndFlush() function? Here is the code tcp server: server h…

TCP threaded server/client

I’m trying to make a threaded TCP server that accept multiple client. It’s only accepting one client. Any idea on how to make the server accepting multiple client? Here is what I tried so far: I changed the server code. I ran both the server and the client, but it seems that it’s only one th…