File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change port on active ServerSocket

 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know of a way to transfer the Socket from ServerSocket.accept() to a differnt ServerSocket? For example, ServerSocket ss1 listening on port 1953 accepts a connection from a remote client. Is there any way to plumb that Socket to a new ServerSocket that listens on port 1980 without closing the original Socket and in a manner that is transparent to the client (the client is oblivious to the port change)?
Thanks in advance.
Mike Morris
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not that I know of. Why would you want to?
- Peter
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
F##$% Firewall! I have a limited block of ports to work with and would prefer not to waste one of those ports as an allocator nor code the clients to discover which port is available. I had the server machine set up as a DMZ, but was getting hacked to death by some script kiddie with a Linux box. I ran a port scan on him with nmap and he had every backdoor client known running on that machine: BO2K, Subseven, etc. Life was so much simpler when the net consisted of benevolent anarchists.
Mike Morris
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic