CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    12

    'Transferring' a socket

    I have a simple question. I have a socket hosting a port, call it port 22. Now, when someone connects, can i have them redirected to another port (say 21) hosted by another application but still running on the same address?
    If so please can you explain?
    Thanks in advance,
    Jason


  2. #2
    Guest

    Re: Possibe, but different situation, from Masaaki Onishi.

    Hi.
    Possible, but the server can't make redirect the packet from the client.
    TCP or UDP on the server side uses this format, (source IP address, port #).
    As a result, one server can be accessed by many client.

    If you generate some code like conuter, gradually the server can change
    port number and the client also change the port # at the same application.
    These client and server will work.
    But remember, the packet from the client goes to the server through the
    port named some number. This is a basic rule. Client and Server must have
    same port number.
    However, the mutilple host can route the packet to the other host.

    Hope for help.
    -Masaaki Onishi-


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured