• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using New IO in heterogenous platform

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am facing problem for following situation,

my client is in perl and server is in Java.

the client sends us-ascii encoded data and server reads it and processes it.

the server used selector based multiplexing for doing the job.
it is as follow.

forever
selector.select()
some channel is interested so get channel
if channel is acceptable
accept it and register it with selector with
read/write operations
if channel is readable
read it into byte buffer
if channel is writable
write a bytebuffer into it
end forever

now my perl client just tries to open a Socket and send data. It does not try to receive anything. My server accpets connection, reads data and also tries to write data on channel.

how is it possible as perl client does not try to read from the socket.

can anyone please make it clear?

thanks in advance.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Harshil Mehta:

how is it possible as perl client does not try to read from the socket.


Your question appears to be "how can my server receive data if my perl client does not read the reply?"
The answer to that question would be that the server receiving the data is not dependent on the client reading it. A socket is just a transport mechanism. It doesn't care what the protocol (standard for data exchange) is. It carries what you tell it to from one end to the other. If the other end isn't listening, the data vanishes when the sockets close. No harm done. Now if you were violating the protocol (i.e. having the client read before sending data) you'd have a problem.
 
reply
    Bookmark Topic Watch Topic
  • New Topic