Questions tagged [socketchannel]

Issues related to socket channel for stream-oriented connecting sockets in Java

A socket channel represents a "selectable channel" for stream-oriented connecting sockets in Java. It is part of the Java NIO library.

249 questions
0
votes
1 answer

Socket Channel - readIntoNativeBuffer() Error

I have been experiencing this issue for a while now. A quick explanation of the system: A simple application will read in data over a tcp connection. The application uses Socketchannel object to establish a data communication line. The connection to…
Php Pete
  • 762
  • 3
  • 14
  • 29
0
votes
1 answer

Android blocking in connect()

I'm writing an Android app that connects to an authentication server to retrieve the IP address and port of another Android device running a separate server program. The authentication server sends the correct connection information when the request…
0
votes
2 answers

SelectionKey iterator.remove() throws UnsupportedOperationException and infinite loop

I have a method that opens a connection, queries a site, gets the number of pages and then uses NIO to concurrently retrieve all of the pages. The first query is done using URLConnection and works perfectly fine. I am running in to 2 issues when I…
J_Tarasovic
  • 114
  • 8
0
votes
3 answers

Cannot extract correct information from message received through SocketChannel

I am sending a string which has been converted into bytes using a DataOutput stream // creates a client socket which connects to the first successor's server. Socket clientSocket = new Socket(host, succ1_port); // send the output_string to the…
user2268507
0
votes
1 answer

Java echo server client using IO multiplexing

I am relatively new to both client server and java programming. Have an assignment to do and I'm stuck with this program to write an echo client and server in java. I've always found my answers here and so once again I resort to stackoverflow. This…
Jones
  • 379
  • 3
  • 9
  • 23
0
votes
1 answer

can we use selector concept in client side programming

I am developing an android application where it has to talk to multiple TCP based servers in run time. Now i am using java sockets to communicate and threads to handle multiple clients. But there is a requirement in application that we need to talk…
Prithvi
  • 3
  • 1
0
votes
1 answer

Java NIO SocketChannel read pre-defined bytes number

I have a Java NIO socket server. The server is getting JSONObjects from remote clients. i'm using the SocketChannel.read(ByteBuffer) method in order to read from the channel. each message ends with '\n' which marks the end of the current message. my…
Asaf Nevo
  • 11,338
  • 23
  • 79
  • 154
0
votes
1 answer

can we use java socketchannel to communicate with c based TCP server

can we use socketchannel to communicate with c++ based TCP server
Prithvi
  • 3
  • 1
0
votes
1 answer

SocketChannel: interrupt close all open channels

I have the following scenario: A server open's a ServerSocketChannel and accept client connections. Every connection (socketA) is handled in a new thread. Inside the thread I open a new SocketChannel (socketB) which connects a another server. The…
0
votes
1 answer

channel for a client server application

I have client server program for transfer of data using windsock but i need something like a client - channel - server in which channel will retrieve the request from the clinet or server will process it and id at that time channel is busy it will…
networks
  • 115
  • 2
  • 8
0
votes
2 answers

Sending data to a client through a SocketChannel after he has closed his

I have a client and a server application where the client sends a byte of data that signals that the user has closed the client window and terminated the client program. The problem is that the server may send one last notification to that client…
Bat0u89
  • 610
  • 2
  • 17
  • 25
0
votes
1 answer

NIO Server/Client sending image problems

Hey guys i have been trying to make a NIO server/client program. My problem is that the server only sends 14 bytes then it won't send anything more. I've sat so long with this that i really can't see anything anymore and therefor decided to see if…
enoze
  • 35
  • 2
  • 8
0
votes
2 answers

how to use netty to transmit the large byte stream(like a image) in a socket service

My server provides socket service for the client. My server's DecoderHandler extends from FrameDecoder. When my client sends small data (bytes less than about 1024) to the server, the server decodes it successfully, but when my client try to write…
0
votes
1 answer

Handling connection given a ServerSocketChannel restart when a client is already open

My SwingWorker's doInBackground() creates (and registers with OP_ACCEPT) a fresh ServerSocketChannel when the user clicks the "Connect" button. When a client isAcceptable(), the SwingWorker registers the SocketChannel with OP_READ. When the user…
Arvanem
  • 1,043
  • 12
  • 22
0
votes
1 answer

Any java libs using SocketChannel client code?

I've looked at a number of open source java networking libs (jdbc drivers, apache commons net etc) and I've yet to find a library that makes usage of SocketChannel for other than simple use cases (V3 of mysql's jdbc connector used socketchannel but…
ozzee
  • 141
  • 5