Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create my personal ServerSocketChannel???  RSS feed

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody, I'm facing a problem that I am not able to solve. I want to create my own version of ServerSocketChannel because I want to offer to clients a customized ServerSocket.
To create a ServerSocketChannel, the static open() method must be called. This method invokes the SelectorProvider.openServerSocketChannel() method which is defined as abstract (therefore I believe some native code will open it for us). The problem is that I cannot cast the returned type to my custom ServerSocketChannel, therefore the accept() method invoked on the returned object will be the one belonging to ServerSocketChannel. I had a look at the source both of SelectorProvider and ServerSocketChannel, and the openServerSocketChannel() method in the former is simply abstract (therefore without implementation).
Please help me in solving this problem,
Thanks,
Marco
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Sockets and Internet Protocols forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!