Solved

Sockets connection....

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Free Alternative to JIRA 4 90
what is a "java.lang.System Property"   ? 20 57
java.io.BufferedReader   readLine()  //returns the entire file ? 4 59
oracle 11g 23 46
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now