Solved

Sockets connection....

Posted on 1998-03-16
1
236 Views
Last Modified: 2010-04-16
Is it possible to open a socket connection and using that
open connection to connect to another server??
The problem is that there is a server  'A' that I need to connect to but I can only do so if I first connect to another server 'B' and to connect to server 'A' from there.
0
Comment
Question by:ABC031698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
jpk041897 earned 150 total points
ID: 1233614
Generaly speaking, uou can set up a bridge using two sockets, but you cannot use the same socket to connect three boxes.

In practice, you could set up a packet switching network on server B, that redirects its input to A, but this implies spetial software, admin leve control over server B and is usualy either more expensive or more trouble than its worth.

A socket is a data stucture that contains information regarding an open connection betwwen to machines. As such it will contain information suc as port numner (SSMTP, FTP, etc), IP address of the desired connection (which is resoveld via DNS resolution from the URL), status, etc.

Contrary to first impretions though, a socket is not, in itself an active connection.

When you open a socket, you are requesting two computers to establish a connection via TCP, UDP or X.25 and to fill in the data structures. The connection itself though is handled by the TCP, UDP or X.25 stack (Winsock for example) and is written over a point to point architecture.

To sum up, if you are the admin, Super user or whatever for server B and can afford to set up server B as a packet swithing net without affecting other software, then you can solve your problem with minimal programming effort. If on the other hand you don't meet these requirenments then  you can set up a bridge as follows (a bridge is a read and forward mechanism).

Set up a listener on Server B, whenever a socket is opend, in B, it can open a client conection to Server A using another socket (it can use the same port, it just has to be a difrent data structure, aka socket). The server app in A can then have a listener that awaits data from B, execute whatever is required from it and then reverse the process back to the original client.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question