Connecting two computers together using an intermediate server.

I'm trying to write a program that allows users to connect to a server and then pairs off users to chat. I setup the connections between the two clients and that works fine, but as soon as the server disconnects from the two clients the connection between the two is lost. The server is always runnning, it sets up sockets that are global to the clients, what am I missing?

I am not very sure how are you trying to do the job. Is it
client1 <-----> server <----> client2
i.e. all message from client1 is send to server which passes them on to client2 and vice versa. If yes, you will loose connectivity when server goes down. Instead, try a an connection client1 directlyt to client2. for this you might need to run a socket server on client2
the pseudo code might look like this
1. client1 connect to server.
2. client1 check client2 is logged in and convays interest to connect to client2
3. client1 gets IP address and port of client2 from server. This info has been convayed to sever when client 2 logged in.
4. client1 opens socket connection to client2
5. client2 has ServerSocket with establishes recieves connection, opens socket and starts chat seesion.
Note that after step 5, client1 and client2 are directly connected and server no longer comes into picture. It only acts as repository for IP address and port of client2.
hope it helps
Amitabh

Similar Messages

  • Cannot connect two computers to the same game server HELP!

    I have a Linksys WRT54G Router.  I have two computers and I want to be able to use them on the same gaming server.  Unfortunately, the game only have one port, so I can only port forward one of my computers.  How can I configure my router to have two external IP addresses to the server so it won't kick one of my computers out.  Thanks!

    Hi,
    I am in a gaming community and many members have a Linksys at home (but I don't know which kind exactly). Many of us try to connect two computers to the same server (many have a family). It seems it is a common problem that no one can connect two computers to the same game server.
    I have a BEFSR41 V3 Firmware version 1.04.8
    I use fixed IP address and no connectivity problem on Internet.
    I have win XP SP2 on both computer.
    I am using a DSL modem
    I can connect the two computers to two different game servers at same time, but not the same server. Default port for this game is the same for all servers I use. I tried with both port forwarding enabled (in that case one PCs can connect the other not) or not (in the second case, whenever the second PC connects, the first one lose his connection to the server, no mater the order I try to connect my PCs).
    Now the weird thing is that one member in my community just decided to throw away his Linksys router and he bought another brand (which I won't name to remains politically correct). Now, without changing anything in his PCs or his connection type, he can now play with two PC on the same server.
    I am seriously thinking doing the same move. Since more and more game are now using Internet (and servers that controls piracy, $$) and family want to play together, not being able to connect two PCs on the same game server makes Linksys in bad situation from marketing point of view.
    For example, in my gaming communtity, we now all know that Linksys can't handle two PC on same server, but other brand can...
    Thank you in advance for your help.

  • To save my life I can't connect two computers together.

    I have a G5 and an iBook G45.
    They both connect to the Internet easily using my cable connection. There is a DLink router that allows both Macs to use the Internet at the same time.
    But these two computers can't see each other. I've turned on file sharing and done everything else under the sun I can think of. Sometimes the IBook can see the G5 but today it has decided that the G5 server is running on the Ibook and I should access files locally.
    The G5 can't see the Ibook ever.
    I can use Firewire to connect easily.

    Hi Stu,
    Can you connect from one using the ip address of the other? The Finder command cmd-k brings up a dialog for you to enter the URI of the other machine. The first part is the protocol (e.g. http, ftp, afp) the next two parts are so unused I forget what they are. The third part is the host name or address and the last part is the filesystem or file.
    So if the machine you wanted to connect to was 192.168.1.10, and it had appletalk filing protocol turned on (personal file sharing) and you wanted to mount Applications, you'd enter
    afp://192.168.1.10/Applications
    You can leave the filesystem off. If that works, then you can connect. That means you only have the problem of seeing. Each computer is supposed to announce its services using Bonjour. There's a great utility called Bonjour Browser (free on versiontracker) which will show you what's being advertised. I have noticed that it sometimes takes a very long time before file sharing is advertised.

  • Connecting two computers, wirelessly, using Airport?

    I have a IMac intel and a PowerBook G4 - 400 Ti. They both have Airport cards. I understand that they will "talk" to each other with out benefit of a router. I would like to know how I can set this up. I have gone through the setup procedures endlessly and, although I did manage to get the IMac to see the PB once, and I don't know how it happened, I have not been able to do it again. There was an icon on my IMac desktop that I could drag stuff to and it would transfer. I'm quite confident its a simple procedure that I, in my stupidity, cannot fathom. When I try to set up a network I get an error message saying : "There was an error joining the Airport Network". Could it be a "slave/master" relationship between the two computers? With a proper setup will the flow of info be two way or one way? Are the two computers or systems incompatible? You help will be deeply appreciated!
    John Callahan

    To my knowledge the information you heard is not
    correct.
    http://docs.info.apple.com/article.html?path=Mac/10.4/
    en/mh914.html
    Any computer that has an Airport Card, or Wireless
    Card (PC) will recognise any network that they are in
    range of by and with the use of a ROUTER, thus
    completeing the 2 way communication.
    There are several different ways to connect and
    confiqure a network, these different ways can be and
    can get confusing without the paperwork on the step
    by step set-up.
    http://compnetworking.about.com/cs/basicnetworking/f/w
    hatsnetworking.htm
    Cheers Don
    Actually none of the Airport cards require a Wireless base station (acting as a router/access point) to work. Airport supports ad-hoc wireless mode (computer-to-computer mode, in Apple lingo), which allows two or more wireless-enabled computers to be connected to each other WITHOUT the use of base station. Search for "computer-to-computer" in the support knowledge base.

  • Connecting two computers using ethernet

    How do i connect two computers to transfer my iphoto library using ethernet? How do I know how long it will run?

    Why not connect the two using Firewire Target mode. Apple explains how in:
    http://support.apple.com/kb/HT1661

  • Connecting two Mac Minis using wifi

    My actual set up:
    Bedroom - Macmini (2007) linked to a dsl modem via an ethernet cable. A Samsung display, a LaCie 2tb drive, are also connected to it.
    In a very near future:
    LivingRoom - Macmini (2011, to be delivered in a couple of days... hopefully) will have access to internet via wifi. A 55" TV, a LaCie Minimus 2tb drive (a clone of the other one in the bedroom) and a DAC will be connected to the new mini.
    My question:
    How can I connect the two minis together using wifi so that I can have easy acces to all the files in the drive connected to the Mac mini in the other room?
    I have looked at the "File sharing preferences" in the system preferences but I am not that sure how to do it.
    A little guidance would be greatly appreciated!

    "File sharing preferences" is indeed how to do it.  Connect both minis to your router (one by ethernet cable, one by wifi, it doesn't matter.)
    Then turn on "File Sharing" in Sharing Prefs on both minis.  Also, give them both meaningful, different names under "Computer Name".
    Then, when you open a finder window on one mini, the other one should appear under "Shared", like this:

  • Can I connect two computers to one device?

    Can I connect two computers to one device? I am trying to have them control different aspects of the experiment that I'm running.

    That depends upon the device. If it's GPIB, you could
    use the E-NET card to convert it to LAN. That would
    allow control by many computers. The only problem with
    that might be sychronization. That is, Computer 1 does
    its setup. Then Computer 2 does a reset. Compuer 1's
    setup is now gone.
    As another poster suggested, you could always network
    between the two computers.
    [email protected]

  • Connecting Two PC's Using Minimum Hardware !

    What are the possbile ways to connect two PC's using minimum hardware ?

    What is single flat layer 2 switch ?
    (Cross over cable You mean Lan Cable)
    ========================================
    I have two PC's which I want to use in a Client-Server setup.
    (both pc's have lan card, usb ports)
    (Qus 1). What Minimum Set of HW I require ?
    (Qus 2). What Minimum Set of SW I require ?

  • How to connect two computers

    please help me
    how to connect two computers through telephone line

    Double Post. See:
    http://forum.java.sun.com/thread.jspa?threadID=770305&tstart=0

  • Connecting Two ASAs together via local interface

    Hi
    I have two cisco ASA routers & wish to connect them together so that traffic between is permitted with out going outside interface.
    Two asa are located at in ONE office and two have separate internet connection (ISP) configured.
    So here is what I did so far.
    configure one of the interface on each ASA with some IP adddress.
    ASA 1  ------- interface 0/6   10.1.1.1  (ASA X 1512)
    ASA 2 --------- interface 0/5  10.2.2.2  (ASA 5055)
    now connected a Ethernet cable to these inferface.
    I was able to addd a route on asa 2.
    route add interface0/5 10.1.1.0/24  10.2.2.2
    but when I add route on ASA 1 I get the following error.
    route add interface0/6 10.2.2.2/24  10.1.1.1
    %invalid next hop address it belongs to one of our interface.

    Sorry if I was not clear
    I have two separate ISPs connecting two two separate ASAs.. Two asa are now connecting separate LANs.
    Now I want to communicate between LANs.
    So I connected an ethernet cable bw ASAs and trying to configure the route.
    But not able to establish
    Here is the configuration of ASA where I am faceing problem, while trying to add route
    route add voice-interface 10.1.1.1/24  255.255.255.0  10.2.2.2 1
    I get error says
    route already exsists
    interface GigabitEthernet0/0
    nameif outside0
    security-level 0
    ip address 0.2.5.2 255.255.255.252
    interface GigabitEthernet0/1
    shutdown
    no nameif
    no security-level
    no ip address
    interface GigabitEthernet0/2
    nameif inside2
    security-level 100
    ip address 192.168.1.1 255.255.255.0
    interface GigabitEthernet0/5
    nameif voice-interface
    security-level 100
    ip address 10.1.1.1 255.255.255.0
    object network NETWORK_OBJ_12.1.3.0_2
    subnet 12.1.3.0 255.255.255.0
    object network NETWORK_OBJ_192.168.1.0_24
    subnet 192.168.1.0 255.255.255.0
    object network OBJ_ALL_NETWORK
    subnet 0.0.0.0 0.0.0.0
    description Any Network
    object network voice-asa-network
    subnet 10.2.2.0 255.255.255.0
    object network 10.1.1.1
    host 10.1.1.1
    access-list outside0_cryptomap extended permit ip 192.168.1.0 255.255.255.0 12.1.3.0 255.255.255.0
    access-list inside2_access_in extended permit ip 192.168.1.0 255.255.255.0 any
    nat (inside2,outside0) source static NETWORK_OBJ_192.168.1.0_24 NETWORK_OBJ_192.168.1.0_24 destination static NETWORK_OBJ_12.1.3.0_24 NETWORK_OBJ_12.1.3.0_24 no-proxy-arp route-lookup
    object network OBJ_ALL_NETWORK
    nat (any,outside0) dynamic interface
    route outside0 0.0.0.0 0.0.0.0 0.2.5.2 1
    dynamic-access-policy-record DfltAccessPolicy
    user-identity default-domain LOCAL
    snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
    crypto ipsec ikev1 transform-set ESP-DES-MD5-TRANS mode transport
    crypto ipsec security-association pmtu-aging infinite
    crypto map outside0_map 1 match address outside0_cryptomap
    crypto map outside0_map 1 set pfs
    crypto map outside0_map 1 set peer 9.2.5.1
    crypto map outside0_map 1 set ikev1 transform-set ESP-AES-128-SHA ESP-AES-128-MD5 ESP-AES-192-SHA ESP-AES-192-MD5 ESP-AES-256-SHA ESP-AES-256-MD5 ESP-3DES-SHA ESP-3DES-MD5 ESP-DES-SHA ESP-DES-MD5
    crypto map outside0_map 1 set ikev2 ipsec-proposal AES256 AES192 AES 3DES DES
    crypto map outside0_map interface outside0
    crypto ca trustpool policy
    crypto ikev2 policy 1
    encryption aes-256
    integrity sha
    group 5 2
    prf sha
    lifetime seconds 86400
    crypto ikev2 policy 10
    encryption aes-192
    integrity sha
    group 5 2
    prf sha
    lifetime seconds 86400
    crypto ikev2 policy 20
    encryption aes
    integrity sha
    group 5 2
    prf sha
    lifetime seconds 86400
    crypto ikev2 policy 30
    encryption 3des
    integrity sha
    group 5 2
    prf sha
    lifetime seconds 86400
    threat-detection basic-threat
    threat-detection scanning-threat
    threat-detection statistics access-list
    no threat-detection statistics tcp-intercept
    ssl encryption aes128-sha1 3des-sha1
    group-policy GroupPolicy_6.2.5.1 internal
    group-policy GroupPolicy_6.2.5.1 attributes
    vpn-tunnel-protocol ikev1 ikev2
    class-map inspection_default
    match default-inspection-traffic

  • How do I connect two lines together.

    I have two lines at an angle but where the corner of the angle is supposed to be there is a little triangle missing. I tried joining the two lines together but when I hit join one line goes past the other.
    Before Joining:
    After Joining:

    There is no need to lock one of the paths, because you do not have to tediously select endpoints just to join paths. Doing so was necessary in Illustrator for most of its history, but it finally (decades behind other drawing programs) gained the ability to join paths at their nearest endpoints by just selecting the paths.
    Undo (or cut) the unwanted join.
    Black pointer: Select the left and right paths.
    Join.
    Alternativley, when drawing line art, it is not uncommon to set your default Graphic Style to use rounded endcaps. That negates the problem of the "missing triangle" (as you call it) appearance of coincident straight end caps.
    JET

  • Connecting two computers with two routes?

    Yes, can I hook up two computers, each with a different router on one phone line?  I hope this makes sense.  I have one main computer hooked up to a wireless/wired router and the one in another room I want to hook up to the internet also.  Do I need another router for that other computer?  The distance on the wireless does not reach to the other computer.

    Here are my educated guess(es) :
    Perhaps you could..
    #1 use a wireless extender?
    #2 use a wireless bridge?
    #3 convert the second router into a hub/switch/wap?
    If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the "Kudos" button.

  • Linking two computers together

    Can I link two macs together so I have access to both but the other computer doesn't have access to mine?

    If you own both and have admin accounts on them, yes. On the "other" computer, go to System Preferences, Sharing, and turn on File Sharing.
    When the two computers are on the same network, you should see the other computer appear in your sidebar in Finder. Click it, authenticate with your admin details (from the other computer), and you now have access to its files.
    Matt

  • BEFW11S4 will not connect two computers at once.

    I have a new set of cables. When I hard wire two computers to router only one or the other will connect.
    Thanks for any suggestions.

    As gv has already requested, please post the output of "ipconfig /all" on each of the two computers.
    In particular, do not -- repeat do NOT -- try to make both computers have the same IP address, because that is a situation in which both will NOT be able to connect to the internet at the same time. They need different -- repeat DIFFERENT -- IP addresses in order to do so.
    Message Edited by arayq2 on 10-18-2008 08:32 AM

  • Connect two computers behind one router

    Hi,
    We have two computers at home. (One with iChat 3, and one with iChat 4)
    We have Netgear WGT624 router.
    We cannot make video chats outside with our AIM/Jabber accounts.
    How should we configure our router to use iChat video in both computers?
    Thanks,
    Yoav

    You should access the Netgear with a web Browser and confirm it is using UPnP
    UPnP allows the computers/Apps to open the ports it needs when it needs them and will allow multiple computers to use the same ports at the same time if requires.
    It SHOULD NOT be doing Port Forwarding (Services) at the same time - nor Port Triggering if that one has it or DMZ as these will clash with UPnP
    4:07 PM Monday; March 24, 2008

Maybe you are looking for

  • Materialized View and I_SNAP$ Indexes

    Hello Everybody, At the time of doing REFRESH of the Materialized View, we are getting error like - SQL> EXECUTE DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF'); BEGIN DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF'); END; ERROR at line 1: ORA-12008: error in mat

  • User's profile in Solaris Express Developper Edition

    I was just wondering, where is the ".profile" in Solaris Epress DE located. In Solaris 10 it's just located in the user's local directory. In other words how can I edit a user's profile in Solaris Express?

  • Kerberos authentication for Excel Services

    Hi, I am configuring Keberos for Excel Service Application and facing some issue. Things i have done so far: Configured web application to use Kerberos: Verified it from server authentication logs, klist and net mon that web application is using kerb

  • OSD doesn't appear on B286HK.

    I just bought the B286HK over the week. Brilliant monitor but I have trouble getting the OSD to appear. I followed the quick start guide and pressed button "5", but the OSD never appears. The only button that appears to do anything is the power butto

  • Time Machine Plus Video Files

    Can you keep your backuup and active files you are using to edit video on the same external drive. Do you need two partitions, or will one do? Thanks in advance for the advice.