Results 1 to 3 of 3
Thread: nio issue
- 03-15-2010, 01:15 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
nio issue
Hi,
I have 2 server sockets accepting connections on ports X and Y. Both registered on selector.
One connection on first server socket has to be mapped to another connection on other server socket.
Messages on connection on first server socket must be passed over to connection on second server socket and vice versa.
How do we handle the mapping part.
Regards
DM
- 03-15-2010, 03:53 PM #2
You are saying that the client is making two connections with the server, correct?
Have the client pass over some form of ID, like a username, which you can use to pair the two connections. If you don't want them to use a username then instead when they connect pass an ID to them (an integer for example) which they pass back to you when they make the second connection.
You can store the two connection in two serperate hashmaps with the id as the key, or in a holding class that stores the two connection and keep that in a single hashmap or list, or you can do it some other way.My Hobby Project: LegacyClone
- 03-17-2010, 05:23 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
Hi,
You mean to say that the other client must send its first message with some unique identfier in the packet?
Let me know if I am wrong in understanding.
Assuming that my understanding in correct, i would require to parse each message in isReadable() to see if the unique identifier is present in it or not.
Is there any other way which can be thought of?
Regards
Deepak
Similar Threads
-
JSF issue
By premjo in forum New To JavaReplies: 0Last Post: 02-14-2010, 02:19 PM -
Issue
By FlashNinja in forum New To JavaReplies: 20Last Post: 11-28-2009, 09:44 PM -
PDF Box issue
By jazz2k8 in forum Advanced JavaReplies: 0Last Post: 03-20-2009, 11:04 AM -
Issue jsp with FireFox
By dimuthunsj in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 10-10-2008, 11:08 AM -
Issue
By chaitu444 in forum New To JavaReplies: 2Last Post: 11-06-2007, 07:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks