Solved

Sockets connection....

Posted on 1998-03-16
1
219 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
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
micro services spring boot application error 3 197
javap bin 2 35
HashTable highest marks enumeration alternative 9 39
sql import cannot be resolved jsp 3 23
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

803 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