socketchannel Questions

2

I want to use Kotlin(v1.3.0) coroutines & java.nio.channels.SocketChannel (NIO) to replace Socket connect (blocking IO) in Android. because this can save many number of threads. The code below...
Talaria asked 12/12, 2018 at 4:32

7

I'm playing around with the NIO library. I'm attempting to listen for a connection on port 8888 and once a connection is accepted, dump everything from that channel to somefile. I know how to do i...
Marty asked 4/10, 2011 at 17:9

2

Solved

What is the best way to set a timeout to close a NIO SocketChannel if there is no data is received for a certain period after the connection is established?
Limitative asked 27/6, 2013 at 10:41

3

How do I secure a Java SocketChannel, ServerSocketChannel or, perhaps even, a DatagramChannel with TLS? I know that there are some frameworks (#1 #2) that advertise to be able, but I want to know...
Nonfeasance asked 2/2, 2012 at 19:6

4

Solved

Ideally, I only need a simple SSLSocketChannel. I already have a component that reads and writes message over ordinary SocketChannel, but for some of these connections, I have to use SSL over the...
Spectacular asked 15/5, 2009 at 9:34

2

Solved

This is a pretty straight forward question, but I have found a need to unregister a selector overlooking my socket channel for java. SocketChannel client = myServer.accept(); //forks off another c...
Tester asked 13/12, 2012 at 19:38

4

Solved

I am currently using a non-blocking SocketChannel (Java 1.6) to act as a client to a Redis server. Redis accepts plain-text commands directly over a socket, terminated by CRLF and responds in-like,...
Bobodioulasso asked 7/2, 2011 at 20:54

3

Solved

I am trying to understand SocketChannels, and NIO in general. I know how to work with regular sockets and how to make a simple thread-per-client server (using the regular blocking sockets). So my...
Billybillycock asked 8/1, 2013 at 23:39

3

I want to use a SocketChannel and to have a timeout for its read/write methods. I've tried to set a timeout for the Socket that owns my SocketChannel like this: channel.socket().setSoTimeout(TIME...
Planimetry asked 19/5, 2010 at 14:42

3

Solved

I have a socket running, using selectors. I am trying to check to see if my socket is connected to the server or not. Boolean connected = _channel.isConnected(); and it always returns true. I tu...
Arnoldoarnon asked 14/8, 2010 at 20:24

1

Solved

I am trying to learn Java. I would like to implement a simple networked connect 4 game as well as a chat feature. I want my network logic to be non blocking so after much study I found that Socket...
Pica asked 21/4, 2010 at 18:27
1

© 2022 - 2024 — McMap. All rights reserved.