Direct Connection between clients using sockets

Hi, I'm a new user and i have a problem with sockets:
The question is how can i directly connect two users that are already connected to a server in other machine???
I mean
user1 is connected to server
user2 is connected to server
user1 tries to communicate with user1 but don't want to use the server, and the server only provides the client1's ip
I first thought to do this:
user2 asks to server for the info of a client1-server waiting for connections, and i think it could work fine, but only if the ports are not closed by firewall, because client-server will be running in a transparent mode for user and user may not know anything about servers, sockets, ports, etc. the user only will work with a gui or something else and that's all
Does anybody know what can i do to make this possible???
PD
Sorry for my bad English

It can be implemented like you said. Make one of the clients open a serversocket and pass the ip and port number through the server to the other client with information on where to connect.
If you're going to use direct connection between clients a lot then I would recommend that every client open a default serversocket at startup and register that information with the server and then every other client can ask the server for the ip and port to whatever client they wish to open a direct connection to.
Be aware that clients often are behind NATs and firewalls, so if need to deal with those issues you got to use hole punching (http://en.wikipedia.org/wiki/hole_punching) - pref on a known port like 80 - and to deal with the less frequently used application firewalls you can use http encapsulation in addition.

Similar Messages

  • Direct connection between 2 clients without any configuration!

    I wan to make a system act like hamachi or logmein (websever & clients).
    I have a webserver on the internet and two client from different networks connected to this webserver, now i want to make directly connection between these clients without any configuration on router. I think it is possible because all infomation about clients network could be got from http request which they send to server. But i don't know what exact fields in the header of http request that i need and how to set them to create connection between clients. I need some ideas about this issue.
    Edited by: tulous on Nov 20, 2008 7:40 PM
    Edited by: tulous on Nov 20, 2008 7:41 PM

    tulous wrote:
    I know, so if you want to use a remote control tool such as: VNC, remote desktop you must config on router or server. But even if you had a proxy(permit port 80) when you type www.sun.com you will get data from it, this data was sent from Sun to your proxy and in some way the data was return to your browser. So i think if we have enough information(it come from the webserver) we could init a connection between 2 client. An example of this is Hamachi.
    At first 2 hamachi clients connect to a server of hamachi, when they have their id, a tunnel between 2 clients was established without any configuration on proxy(certainly that server did not deny port of hamachi). From now 2 clients can exchange data not through the server. The same in logmein, you can remote desktop any where with zero configuration, but the speed is guarantee because they contact to server for query information, but the data was transmited directly. Sorry if i make mistake.It doesn't work the way you think.
    There is a proxy or you have to have one side listening with a ServerSocket and have ports opened as needed. You can't create a Socket connection on server A between clients B and C and then pass it off to clients B and C and magically they just talk to each other.
    It does not work that way. It is impossible to do it that way.

  • HOw to connect FTP Client using flex

        Hi Everyone,
                   i am new to flex, i am developing one flex application, some one give example of connecting ftp client using flex. i didnot found any examples.
    thnx

    You would need to communicate with your ftp server over a socket and implement the ftp protocol on your client. The project below aims to do this, but I have never used it:
    http://maliboo.riaforge.org/
    Why not download over http (and save yourself a lot of time)?

  • Direct connect to Oracle using Delphi

    How I can direct connect and transfer data from Oracle Database using Delphi.
    Not via ODBC driver!!!

    There are several BDE replacements that allow you to connect to
    Oracle from Delphi with out BDE or ODBC
    DOA- Direct Oracle Access from Allaround Automation ~$200.00
    http://www.allroundautomations.nl/index.html
    NCOCI8 is freeware.
    Goto to www.kylecords.com and they list BDE replacements.
    I use DOA and their PL/SQL developer systems from Allaround
    Automations and they are both excellent systems with excellent
    support.

  • Communication between applets using socket

    Hi,
    we have an application in which based on certain criteria a video is bieng played in the applet on same machine.Now we have to separate the video component from the application part so that video can be played separately. they will be communicated using socket.Can any body tell me how to go about for the solution.

    To do this you must have a server application listening to a port on a server box that has a fixed IP. In your Java app, you need to create a Socket connection back to the server (may need to sign your jar - but maybe not)
    voila you're there.
    You may want to search google + these forums for my InfoFetcher class which is built to grab data from an inputstream and report updates to listeners

  • When client use socket to connect server, server how to get client IP

    as topic

    Your ServerSocket has an accept() method that gives you a Socket. The Socket class has a getInetAddress() method... I'll let you continue reading the API documentation from here.

  • Connections between servers using CSS VIP?

    In our new pre-production environment we have several servers connected to a 3750 switch, which is then connected to a CSS 11503. Upstream the CSS is then connected to an ASA firewall pair. The CSS VIPs are 10.22.1.0/24 on the "outside" and the servers have 10.21.1.0/24 addresses on the inside. The CSS inside & server 3750 switchports are all on the same VLAN. There is no PAT/NAT configured (except for the VIP being translated to a chosen server IP I suppose).
    Whilst the clients will connect to the servers via the VIPs what we want is for each server to also be able to talk to other servers via a VIP. This is because some of the servers provide a service (LDAP actually) that we would like to be load balanced.
    Now, what is curious, is that *this works* in our production environment where the servers are *directly* attached to the 8 port switch module in the CSS. However in this new environment, where the 3750 is between the servers and the CSS, it doesn't (actually you can ping the VIP sucessfully but nothing else works).
    I have seen other postings on NetPro where people are trying similar things, like: http://forum.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Networking%20Solutions&topic=Application%20Networking&CommCmd=MB%3Fcmd%3Ddisplay_location%26location%3D.1dd81312 and http://forums.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Emerging%20Technologies&topic=Content%20Networking&CommCmd=MB?cmd=display_location&location=.1dd72fd0
    The relevant CSS config I think (there are lots more services etc but they are all similar) is:
    circuit VLAN1
    ip address 10.21.1.100 255.255.255.0
    circuit VLAN2
    ip address 10.22.1.1 255.255.255.0
    keep alive ssokeepalive
    type http
    keepalive port 7777
    uri "/sso/status"
    keepalive frequency 10
    keepalive maxfailure 2
    tcp-close fin
    active
    service pulpldp001sso
    ip address 10.21.1.6
    keepalive type named ssokeepalive
    active
    content SSO
    vip address 10.22.1.12
    protocol tcp
    port 7777
    application http
    url "/*"
    advanced-balance cookie
    add service pulldp001
    active
    i.e. VIP 10.22.1.12 will be directed to the server 10.21.1.6 (only the one shown above).
    Q1) My first question is: is server to server communication via an outside VIP possible?!
    Q2) Given that this seems to work our production environment without the 3750s any idea what areas of config could be wrong on the 3750 or the servers? (we've tried default routes of both the 3750 and the ISS inside address but that hasn't worked). Note the ping from a server works but when we try, say, "telnet 10.22.1.12 7777" that doesn't connect.
    Q3) Let's assume that the servers run more than one service, e.g. an HTTP and an LDAP service. If a server can communicate with another server using its VIP, will it work from one server up to the CSS/VIP and back to itself? (of course it may or may not actually return to itself depending on the load etc)
    I can provide full configs on Monday if required.
    Hope these aren't dumb questions! Many thanks!
    Simon
    PS. the CSS is running 7.50 at the moment but could upgrade to 8.2 if required

    Thank you Adedayo - that appears to have done the trick! I can't believe it: one little keyword!
    I have to say, even once you told me the answer I still didn't find the Cisco content config manual very helpful on this point (perhaps I'm looking in the wrong place?).
    Note: we're not currently doing any PAT on the CSS so don't have any source groups set up - perhaps most people do and so don't have the same problem.
    I'll get chance to report back on some proper testing next week and promise to update this conversation.
    Adedayo: sorry, I wanted to flag your post as solving my problem once I was sure next week but now the tick box has gone - if you reply again I'll flag that! I appreciate you taking the trouble to post.
    One final question: do you have a situation where you use a VIP from a server to potentially connect back to itself? If so, does it work OK? (e.g. if you have a webserver can you connect to the content VIP that it belongs to?)
    Simon

  • Direct connection between 2 SPA9000

    I'm considering on buying SPA9000. My question is: is it possible setup a call through 2 different SPA9000 located on different site directly, without using ITSP intermediary. Can a line on one SPA9000 be set to register to a line on another? Can I use 2 adapters in different sites to directly route calls between them without using ITSP? TIA

    IP dialing is the only option that you have for this one. IP dial between the SPA9000.
    But it still it as if you are calling to an ITSP.  You cannot register a line of a 9000 to another.
    Another scenario to consider is setting up a VPN tunnel between two location.
    setup a 9000 on one end, regsiter all the phones there and then take the phones needed to the other location. with a stable VPN connection you should be able to make call betwee local extension. Just dont expect full functionality on the remote ends.

  • Direct Connection Between OSX and Ubuntu (Jaunty)

    Hello:
    I Bought my MacBook a few weeks ago and i want to transfer some information from my pc, which runs Ubuntu Jaunty. What should i do?
    Thank you

    Jarojasag wrote:
    Hello:
    I Bought my MacBook a few weeks ago and i want to transfer some information from my pc, which runs Ubuntu Jaunty. What should i do?
    yo can do it via an external drive formatted FAT so both systems can read and write to it. or yo can use file sharing and connect the computers via smb or afp.
    they need to be on the same local network. don't know how file sharing works in Ubuntu but on a Mac you need to go to system preferences->sharing and enable file sharing.
    Thank you

  • Procedure for transfer data between clients using ALE

    Hi all ,
       I am new to this concept .
       I want to transfer the material master data from quality client (200)  to  Development Client(100) using ALE and IDOC, how to do ?
    What would be the procedure ? plz let them explain step by step of definition along with screenshot / process ....
    Regards
    Deepa.

    T.Code: BD54
    Step 1:create a logical system qaout in quality system
    Step 2:create a logical system devin in quality system
    Step 3:create a logical system qaout in development system
    Step 4:create a logical system devin in development system
    T.Code: SCC4
    Step 5:Assign qaout to 200 client in quality system
    Step 6:Assign qaout to 100 client in development system
    T.Code: SM59
    Step 7: Create R/3 type (or ABAP type in ECC)RFC destination RFCDEV in quality system
    T.Code: WE21
    Step 8: create Port with above rfc reference in quality system
    T.Code:BD64
    Step 9:Create distribution Model (use matmas message type) in quality system
    then  Environment ->Generate Partner profiles
    Then Edit ->modelview -> distribute
    T.Code: BD10
    Step 10: select the material for distribution in Quality System.

  • A GUI problem when using sockets

    I have a problem with Client.java. it creates a socket to connect to a serversocket. I do this through the method "runClient()" .
    the problem is that if I call runClient from an actionlistener add to a button. here the graphics of the window will disappear and you will be stuck for reading input (input.readObject())
    On the other hand , if you call runClient automatically from the class constructor "Client()" the program will work normally.
    can anybody give me a hint what's going on?
    Why does the program blocks in the first case for input?why not the second?
    //Client.java
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Client extends JFrame
         private JTextField enter;
         private JTextArea display;
         private JButton connect;
         ObjectOutputStream output;
         ObjectInputStream input;
         String message = "";
         public Client()
              super("Client");
              Container c = getContentPane();
              enter = new JTextField();
              enter.setEnabled(false);
              enter.addActionListener(
                   new ActionListener() {
                                  public void actionPerformed(ActionEvent e)
                                       sendData(e.getActionCommand());
              c.add(enter ,BorderLayout.NORTH);
              display = new JTextArea();
              c.add(new JScrollPane(display), BorderLayout.CENTER);
              connect = new JButton("Connect");
              connect.addActionListener(
                   new ActionListener() {
                                  public void actionPerformed(ActionEvent e)
                                       //TRY THIS . . it won't work
                                       //runclient();     
              c.add(connect, BorderLayout.EAST);
              setSize(400,300);
              show();
              //This works normally
              runClient();
         public void runClient()
              Socket client;
              try
                   display.setText("attempting to connect \n");
                   client = new Socket(InetAddress.getByName("127.0.0.1"),3500);
                   display.append("connected to : " + client.getInetAddress().getHostName());
                   output = new ObjectOutputStream(client.getOutputStream());
                   output.flush();
                   input = new ObjectInputStream(client.getInputStream());
                   display.append("\nGot I/O streams\n");
                   String message = "Client>>> Connection successful";
                   output.writeObject(message);
                   output.flush();
                   enter.setEnabled(true);
                   //YOU WILL GET STUCK HERE
                   do
                        try
                             message = (String) input.readObject();
                             display.append("\n" + message);
                             display.setCaretPosition(display.getText().length());
                        catch(ClassNotFoundException cnf)
                             display.append("unknown error\n");
                   } while( !message.equals("SERVER>>> TERMINATE"));/**/     
                   display.append("\nClosing Connection");
                   input.close();     
                   output.close();
                   client.close();
              catch(EOFException eof)
                   System.out.println("Server terminated connection");
              catch(IOException io)
                   JOptionPane.showMessageDialog(this,io.getMessage(),"Server Error",JOptionPane.ERROR_MESSAGE);
         private void sendData(String s)
              try
                   message = s;
                   output.writeObject("CLIENT>>> " + s);
                   output.flush();
                   display.append("\nCLIENT>>>" + s);
                   enter.setText("");
              catch(IOException e)
                   display.append("\nERROR writing object");
    }

    The problem is that you can NOT access a method between classes unless the method is static.
    THIS IS WRONG!
    public class Jack{
    private pale;
    private void GoUpHill()
    {pale = full;}
       public class Jill{
          public init()
          Jack.GoUpHill();
    }It is wrong because "private void GoUpHill()" is not declared as static.
    THIS IS CORRECT!
    public class Jack{
    private pale;
    private void GoUpHill()
    {pale = full;}
       public class Jill{
          public init()
          Jack.GoUpHill();
    }Note that "private static void GoUpHill()" is declared as static. That will work, but it will give an error because "pale" is not declared static. Obviously, you're going to need to make all your objects static... or, you could do this:
    public class Jack{
    private pale;
    private void GoUpHill()
    {pale = full;}
       public class Jill{
          public init()
          Jack jr = new Jack();
          jr.GoUpHill();
    }A new instance of the Jack class is made so you can use GoUpHill() at will. You don't need any static methods or objects if you use that method... but it might not always do what you want it do.

  • WS Adapter - Mandatory Parameters  - Direct Connection

    Hello Friends,
    We try to create create one Pass Through interface between 2 SAP Systems (Proxy to Proxy) using Direct Connection option in ID.
    We have PI 7.11 (EHP1). For the receiver system we have created one communication channel of adapter type WS and Adapter Version SAP BASIS 7.10.
    In this channel, it shows 3 Mandatory Parameters: 1) Target Host 2) Service Name/Port 3) URL Access Path.
    We have entered the Receiver SAP Host name for the 'Target Host' Parameter.
    For the 2nd one, do we need to enter Java Port or HTTP Port Number of the receiver?
    For the URL Access Path, what do we need  enter ?  (I read from SAP Help, needs to enter Client Number if it SAP Ssytem. But, If enter this, it did not ask user name and password).  Moreover for this Business System in ID, there is no Logon Tab.
    Could you please clarify friends?

    >
    Olian Saludew wrote:
    > Hi guys,
    >
    > is the new WS adapter designed only for Direct Connection between 2 SAP Systems? Or can I use it also in a SOAP->PI->WS (Abap Proxy) scenario?
    >
    > Is there somebody who has developed this type of scenario?
    >
    > Thanks,
    >
    > Olian
    it can be used for direct connections as we as connectivity to IS.
    http://help.sap.com/saphelp_nwpi71/helpdata/en/45/37d74180554c2ce10000000a1553f6/frameset.htm
    But I dont think you can use it for ABAP proxy, It is usually for WS communication
    for ABAP proxy you can use the XI adapter - http://help.sap.com/saphelp_nwpi71/helpdata/en/43/96cbccb9335b77e10000000a11466f/frameset.htm

  • CSM module: rserver to rserver (or VIP) connections between serverfarms

    Hello,
    I am trying to audit an existing configuration of CSM module.
    Unfortunately have not an experience in CSM module configaration.
    The main goal is to understand if there are any direct connection between servers
    in different serverfarms (i.e. server from one serfarm opens session to server in
    second serverfarm to VIP or to real IP). Also I need to know if there exist any
    server initiated connection.
    For serverfarms in CSM configuration there are two options configured
    1)
    nat server
    nat client <pool>
    2)
    nat server
    no nat client
    As I understand, if there is no "static nat" lines in CSM configuration it means that
    there can not be server initiated connections. Is this correct?
    What is the best way to check if there are any direct connections between different serverfarms?
    Is it enough to take an output of "show conn" command like
        prot vlan source                destination           state      
    In  UDP  149  10.13.205.20:57944    10.36.22.20:23235     ESTAB      
    Out UDP  449  10.36.22.24:23235     10.13.205.20:57944    ESTAB      
    and check if there is "In" connection from <source IP> in one serverfarm to <destination IP>
    in second serverfarm? As for now I did not see such connections.
    Will be presented direct server-server/VIP or server initiated connections in "sh conn" command
    output for CSM module?
    Could you advise me how to check this in CSM configuration or show commands output?
    Thank you in advance.

    If the vserver to vserver connection is made between devices in the same subnet and the client uses the vsever address (rather than a vip address) then this will not be seen via the CSM at all. If the client vserver targets the vip address, then it is probable that you will require source nat to make it work. If a vserver starts a connection to another vserver addess (not vip) in a different subnet and the connection flows via the CSM,  then the CSM will show this in its connection table. You can test this via "telnet " and check the connection table. Any working vserver to vip connections will be visible in the connection table. Matthew

  • Direct-connect inside network with dynamically assigned IP-addresses

    I have 13+GiB of files to transfer between two computers (one arch and one Win7) and would rather not spend the day moving them ~1GiB at a time via flashdrives.
    I have tried setting up an ad-hoc network on the win7 machine, but wifi-menu fails to connect to it.
    I have tried setting up an ssh server on the arch machine and accessing it via PuTTY on the Win7 machine.
    I have tried setting up an apache server on the arch machine and accessing it via firefox on the Win7 machine.
    I do not have the permissions to statically assign ip addresses on the network, and need to somehow directly connect between these two computers.  Any suggestions?

    5donuts wrote:I've spent the last hour or so trying to set up samba, but I can't figure out how to connect to a Windows shared folder with smbclient, and just cd-ing into the mountpoint doesn't work since access is denied
    Post the exact commands that you are using and the exact error messages that you receive.
    For mounting windows shares I use variations of the following command:
    mount -t cifs //<windows ip address or host name>/<windows share name> /mnt/foo -o nosetuids,uid=<your local user id>,gid=<your local group id>,user=<windows user name>,workgroup=<windows workgroup>
    Have you tried something similar? It should "just work".

  • Does PeerFinder support multiple Wi-Fi Direct connections or just one?

    Hi,
    Based on the Proximity sample I was able to establish a wifi direct connection between two win8 machines.
    http://code.msdn.microsoft.com/windowsapps/Proximity-sample-1c85d4c0
    However I have yet to get a WinStore app to connect to two or more machines.  Is this a limitation with PeerFinder?  Are connections capped at one?
    Thanks,
    Richie

    I found this limitation on
    Link MSDN:
    You can connect to only one peer at a time if your app is in the peer or client role. If your app is in the host role, you can connect up to
    5 clients at a time.

Maybe you are looking for

  • Trying to edit psd file and it adds another layer

    I have a psd file that was created to use as a template (it is all text).  When I try to edit it, it won't let me, instead another layer is added to the file, instead of allowing me to edit the layer that I am in.......what am I missing???

  • How do I change the screen size to standard in iMovie 10?

    I can't seem to find where to change the screen to standard size - in previous imovies it gave the option when creating the new project but this version doesn't seem to.

  • Database exception: undefined error when uploading personalized object

    I have an object I've extended based on the article at the Oracle Application Hack website. [Oracle Application Hack|http://oracle-hack.blogspot.com/2009/05/how-to-extend-view-object-in-oa.html] However, when I try making the call locally to import m

  • 4630 Scan Failed to complete error - OS X Yosemite

    I bought the 4630 about a month  ago and have tried scanning on 3 different Macs running OSX 10.10.1.  The first scan after initial set up works.  After that, I get either "The overview scan failed to complete" if the Details window is open or "The s

  • No sign of Qmaster programme in finder

    Hi all Following from problems with having Compressor not opening i re installed Compressor and FCP 5.0 but now i have no Qmaster or Quadministrator in the applications folder. I seem to have the est of the package in the various folders. What might