Java chat program, works on single PC, but not over internet?

I got bored so I started writing a chat client in java, its IRC style, a server and as many clients as you want. It works fine on a single computer (using 127.0.0.1 as the IP) but not over the internet.
I've tried running the server and client on my home PC, set up the ports to be forwarded on my router and enabled them in the windows firewall but I get the error "Connection refused" when trying to connect using my external IP (ISP) address, same with me running the server and a mate running the client.
The class chatHandler was basically stolen off the internet, the rest I wrote myself or modified bits of code to suit. I wrote it in netbeans with the GUI builder.
I've hosted both projects in the single zip, if you want to run the application just open the .jar file in the dist folders, or view the source via the src folder, or alternatively you can load the project up in NetBeans so its easier to play with the GUI.
So yeah if anyone can help me out with why its not working that'd be great, I've added the port to my firewall (default 60111). My ultimate goal is to implement an actual protocol so it isn't just sending plain text, then I can easily send files to mates etc.
http://rapidshare.com/files/208309140/ChatProgram.zip.html
Edited by: rolls on Mar 12, 2009 4:58 AM

what I have done recently is this:
have added java.exe, javaw.exe, the ports Im using to the windows firewall and also the ports I am using to my router.
I have also tried changing :
server = new ServerSocket(port);
to:
InetAddress IP = InetAddress.getByName(IPAddress);
server = new ServerSocket(port, backlog, IP);
(IPAddress = 192.168.1.3 my lan NIC)
As I believe it was binding to my local loopback adaptor, hence not seeing any packets when using a packet analyser, however now I get an exception, after printing a stacktrace from the client I get this.
However I can now connect using 192.168.1.3 just not using my external IP address.
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at chatclient.Client.run(Client.java:60)
at java.lang.Thread.run(Thread.java:619)
Why is my connection getting refused? I've set up a virtual server and port forwarding on my router, and turned off the windows firewall.

Similar Messages

  • FORALL MERGE statement works in local database but not over database link

    Given "list", a collection of NUMBER's, the following FORALL ... MERGE statement should copy the appropriate data if the record specified by the list exists on both databases.
    forall i in 1..list.count
    merge into tbl@remote t
    using (select * from tbl
    where id = list(i)) s
    on (s.id = t.id)
    when matched then
    update set
    t.status = s.status
    when not matched then
    insert (id, status)
    values (s.id, s.status);
    But this does not work. No exceptions, but target table's record is unchanged and "sql%rowcount" is 0.
    If the target table is in the local database, the exact same statement works:
    forall i in 1..list.count
    merge into tbl2 t
    using (select * from tbl
    where id = list(i)) s
    on (s.id = t.id)
    when matched then
    update set
    t.status = s.status
    when not matched then
    insert (id, status)
    values (s.id, s.status);
    Does anyone have a clue why this may be a problem?
    Both databases are on Oracle 10g.
    Edited by: user652538 on 2009. 6. 12 오전 11:29
    Edited by: user652538 on 2009. 6. 12 오전 11:31
    Edited by: user652538 on 2009. 6. 12 오전 11:45

    Should throw an error in my opinion. The underlying reason for not working is basically because of
    SQL> merge into   t@remote t1
         using   (    select   sys.odcinumberlist (1) from dual) t2
            on   (1 = 1)
    when matched
    then
       update set i = 1
    Error at line 4
    ORA-22804: remote operations not permitted on object tables or user-defined type columnsSame reason as e.g.
    insert into t@remote select * from table(sys.odcinumberlist(1,2,3))doesn't work.

  • XML (RSS) Spry Dataset File Works in Preview But Not Over Internet

    hello
    I am trying to build a custom feed reader using the Spry framework in Dreamweaver CS4 and everything seems to go smoothly until I actually host the file (with the accompanying js and css files) and try to view it over the internet
    previewing from DW shows everything working the way it should
    I feel like I am missing something obvious ... but not sure what
    thanks for any help!

    Hi, i have a similar problem..
    These URL returns a XML:
    1) http://www.bolsadesantiago.com/intradayServlet?symbol=IPSA
    2) http://www.valorfuturo.com/contenidos_vf/proyectos/clientes/penta/titularnoticias.asp
    I use a CS4 and both works in preview, but only first works over internet (IE7).
    I suspect that 2° has a problem of syntax XML, but work with jQuery.

  • Program working in virtual device, but not on physical device

    I made a program, pretty simple, actually, that simply consumes a web service here on my local network.  Pretty much all it does is try to authenticate.
    I had a problem with DNS before with the androids, so i replaced all of the domain names in the service xml files to IP addresses,  which still works virtually, but again, not on the physical device.
    Any ideas?

    Hello,
    Regarding the procmon capture;
    Yes, it is a lot of data. I would just start at the top and read my way down on both captures and then identify areas which they differ. Without understanding where the two captures differ, well - it would seem hard to understand where the difference in
    behaviour starts?
    Of course you can minimize the data by (this seems rather obvious, but lets re-iterate);
    1. Avoid all and any unnecessary background tasks
    2. Monitor normal system activity and exclude that
    3. Learn the application behavior and decide if you want to monitor only the application, or all system activity
    4. Understand the application
    As you have a working / non-working scenario - this seems like a perfect scenario of using ProcMon.
    Nicke Källén | The Knack| Twitter:
    @Znackattack

  • Works in applet viewer but not in internet explorer

    I origionaly posted this on devshed. I got 55 views but no replies. It seems to be a common problem to which no one knows the answer. Surprise me :O)I'm sure this is a really common but there seems to be surprisinly litttle on the web about it.
    I developed a game applet a while ago in applet viewer and am now thinking about putting it on my web site. However I have found that it doesn't work in internet explorer. I can browse other sites using Java fine. There is clearly just something about my applet that ie doesn't like.
    Does anyone have any suggestions? What sort of things upset ie?
    All help very much apreciated, you are very nice people
    Flo.

    There must be some thing that tells you it isn't working. You should tell us so we don't have to guess. Does the browser hang? Do you get an error? Did you try opening the Java Console to see if there were any messages? I am guessing that your code is using something that the security level of an Applet does not allow (but appletviewer does allow).

  • Lightbox widget works properly on dreamweaver but not on internet browser

    Hi,  I am using Dreamweaver CS5 & I used lightbox gallery widget through insert widget on insert panel menu. I edited the image source so everything seems working fine when I preview it on live button (local view). but when i try to view it on internet browser, it only shows the picture and when I click on the photo, it will come out at the very end of the page instaed of just zooming in & make the background darker. Here's the link of my webpage that I am talking about. http://www.thefamily-connect.com/Pages/Tina%20&%20mike%20photos.html
    I have the same problem with Spry Image Slideshow, when I view on internet browser, it says error 404 is found.
    What am I missing to make these widget work in internet.  kindly  email me your reply at [email protected]
    Thanks!
    Joyce Forrest

    sorry, I did not have experience about this... I can only read your problem.

  • Works fine with Safari but not with Internet Explorer

    Hi, I just created a website using iWeb, and it looks great in Safari in my Mac and iphone, but when I try to open it in Vaio using Internet Explorer, I get some problems. Sometimes the page just don't open, and when it opens, the fonts are not the same, and things are moved around. What can be the problem and how can I fix it? By the way, I use mobile me for hosting, and my site is www.ogucuo.com
    Thanks!

    When you use a font that is not "Web Safe" the computer that downloads your page may not have that font installed. It substitutes another one and this causes the text box to expand and push the other stuff around.
    If you enter some text into a box on an iWeb page and then change the font you will see how the text box expands to accommodate a bigger font.
    If you really want to use a special font, sparingly, convert it to an image by typing it into a shape or putting a slight shadow on it in the "Graphic" inspector. The iWeb help menu will tell you about this.
    If you turn on "Show text imaging indicator" in iWeb preferences you will get a visual indication of the text being converted to an image.
    I say sparingly because each image increases your page file size and download time.

  • I have an ipad 2 the itunes program worked fine at first but now it will not connect to the store. it says 'secure link to itune store failed' i have uninstalled it and reinstalled it. what do i do

    i have an ipad 2 the itunes program worked fine at first but now it will not connect to the store. it says 'secure link to itune store failed' i have uninstalled it and reinstalled it. what do i do?

    Doublechecking before proceeding. Is iTunes endlessly saying "Accessing iTunes Store"? Or is something a bit different going on?

  • Site works in the app, but not in the browser.

    Hello iWeb experts,
    I've got problems.
    Last night I published my site. And while it appears, and functions, properly in my iWeb app, it doesn't do the same in Safari, Firefox, and Internet Explorer.
    Two issues...
    FONTS
    I chose Bellamie, Univers Condensed, and Marydale as my fonts. From reading these forums, I've discovered those won't wysiwyg on other computers if the fonts aren't available and open on them. So my two choices are to make every bit of text a graphic or to use a set of more universal fonts, correct? So my questions are...One, is there a list somewhere of fonts that will work in any browser? And, two, is there a short-cut, or easy way to transform type into a graphic without having to create image files?
    FUNCTIONS
    Here are the functions that work fine in iWeb but have gone haywire in all of the browsers I tested...
    • The type in one nav link appears smaller than all the rest.
    • Some links are active, others are not.
    • Rollover highlighting works on some links, but not others.
    • Most of the rollover links appear in the proper static color, a few do not.
    I've tested these functions on three Macs, one PC, and in the three browsers mentioned above. All of them show the exact same problems. So something must be going wrong with iWebs coding, or my host server musn't like iWeb.
    Any thoughts, suggestions on these two issues? Thanks much for any advice.
    John
    PS - For reference, see: www.johnrunk.com

    Fascinating, Kirk (+he types with one raised eyebrow+).
    QuickTimeKirk wrote:
    When I drag across your page most of your links do not change. The "text" portion of them doesn't change, either. Something is covering them.
    I can see that. But for the life of me, I don't know what could be covering those links. In my app, when I click in the area of the links, the type is the first item selected. Unless, possibly, it could somehow be the faint reflection of my black-and-white image (me & the ground I stand on). Hmmm...
    QuickTimeKirk wrote:
    Single click (outside the boundaries of your page contents) and an "outline" will appear. It shows the image file dimensions and locations.
    This I don't see. An outline? As in "an object outline," or as in "a list of dimensions and locations?" When I click outside my page contents, I get nothing.
    Thanks, QTK. I truly appreciate your troubleshooting here.
    John

  • Windows 8.1 64bit. Webcam works with "Camera" app but not with Skype.

    I've spent a few hours googling and trying out various things - all listed below. I give up - any ideas??? OS: Windows 8.1 64bitMemory: 32GBWebCam: Microsoft VX-7000. As per subject - the webcam works with the "Camera" app but not with Skype for desktop or for Modern UI (or the Microsoft Lifecam software for that matter).  Already attempted: 1) Uninstall webcam drivers - download latest from microsoft (Windows 7) and install in Windows 7 compatibility mode.2) Close (from taskmgr) anything that looks like it might use Webcam. 3) Run Skype for Desktop in Windows 7 and 8 compatibility modes None of the above work. In Skype for Modern UI the webcam doesn't appear in the drop down in Settings - so I can't even select it. In Skype for desktops (version 6.11.32.102) the webcam is found but instead of image I get "Can't start video. Try closing other programs that might be using your webcam". I see from a bit of googling that various people seem to have the same issue (i.e. Webcam works with Camera app but not Skype) - so I'm hopeful someone has found a workaround / fix to this issue and I've just not had the googling skills to find it  Thanks, - Matt Symes

    OK - I appear to have resolved the issue.  I restricted my google terms to [vx-7000 site:microsoft.com "windows 8.1"] Which uncovered this article: http://support.microsoft.com/kb/933311 I noticed there were a couple of Windows 7 x64 specific registry settings that were mentioned so I checked these and they weren't as per the article. In fact - one of the Registry Keys was already used by other software "AI Charger+" which is some ValueAdd software that came with my motherboard. I uninstalled AI Charger+, uninstalled LifeCam driver. Reinstalled LifeCam driver in Windows 7 compatibility mode. Still not working. I returned to the registry and noticed the settings still differed from the above article. I corrected them (which involved not just amending Data but having to add new Values). I then disabled and reenabled the LifeCam from dvcmgmt.msc I was then able to get video from the webcam in the Skype for Desktop preview screen.    

  • Magic Mouse One-Finger Swipe Works for one user but not the other

    For the main account on my iMac, I can use a single finger swipe to move back and forward within Chrome. However the second user (also an administrator) cannot use this setting and must instead use the two finger swipe in settings. Both settings are identical but the Chrome browser wont recognize the single finger swipe for the second user. The gesture works fine in Safari, but not Chrome. Any suggestions?

    my /etc/group:
    root::0:root
    bin::1:root,bin,daemon
    daemon::2:root,bin,daemon
    sys::3:root,bin
    adm::4:root,daemon
    tty::5:
    disk::6:root
    lp::7:daemon
    mem::8:
    kmem::9:
    wheel::10:root,hans,ibm,gast
    ftp::11:
    mail::12:
    uucp:x:14:
    log::19:root
    locate:x:21:
    smmsp::25:
    http::33:
    games::50:
    network:x:90:
    video:x:91:
    audio::92:ibm,gast
    optical::93:hal
    floppy:x:94:hal
    storage:x:95:hal
    scanner:x:96:
    power:x:98:
    nobody::99:
    users::100:gast
    dbus:x:81:
    hans:x:1001:
    vboxusers:x:108:hans
    policykit:x:1002:
    hal:x:82:
    kvm:x:78:
    nx:x:85:nx
    avahi:x:84:
    camera:x:97:
    gdm:x:1003:
    gast:x:1004:

  • My applet works in the appletviewer but not in the navigator

    My applet works in the appletviewer but not in the navigator
    exceptions problem1 and problem2 are throwed
    this is my code
    import java.applet.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ValiderHtml extends Applet implements ActionListener {
    JButton send =new JButton("Connexion");
    JScrollPane jscrollpane= new JScrollPane();
    DefaultListModel lignes=new DefaultListModel();
    JList lstURL = new JList(lignes);
    BufferedReader reader = null;
    String ligne;
    URL url;
    URLConnection conn;
       public void init(){   
       this.setSize(900,400);
       setLayout( new GridLayout(2,1));
       jscrollpane.setBounds(new Rectangle(19,53,160,73));
       jscrollpane.getViewport().add(lstURL,null);
       send.addActionListener(this);
            this.add(send);
       this.add(jscrollpane);
        public void actionPerformed(ActionEvent evt) {
             Send();
       public void Send(){
            try {
       url=new URL("http://www.developpez.com");
       conn = url.openConnection();
       reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    while ((ligne = reader.readLine()) != null) {
                     lignes.addElement(ligne);
        }//fin bloc try
       catch (Exception e) {
                   lignes.addElement("probleme1");     
                finally{
                   try{reader.close();}catch(Exception e){ lignes.addElement("probleme2");}
       }// fin Send
          public void paint(Graphics g) {
                super.paint(g);
    }// fin Applet

    As for tracking the source of your problem your applet sucks.
    Try e.printStackTrace() on a cought exception and check the (full) trace.
    url=new URL("http://www.developpez.com");
    Unless yor applet is on www.developpez.com this will throw an exception in an unsigned
    applet without special policies.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and last post for the java class file
    http://forum.java.sun.com/thread.jsp?forum=63&thread=409341
    4th post explaining how to set up your own policy with your own keystore

  • I use Photoshop Elements 11 to print panoramas. Works for jpeg images but not tiff. Suggestions?

    I use Photoshop Elements 11 to print panoramas. It works for jpeg images but not for tiff images. Seems strange because PSE11 manages tiff images in all other processes. Anyone fared better?

    Thank you for your trouble.
    My images are not usually layered and the particular case I am about to quote, it is not. The dimensions are 10,546 x 2,790 and the image has 16.7 mbs. I use 8 bit colour. When I set up the print screens for tiff, everything is normal until I get to the last screen with the image set upon the photo paper. Then the paper size indicated with the image refuses to budge from the A4 size, so the panorama gets printed on that. I consulted the Adobe chat line and the expert could 't get it to work either. So he came to the conclusion that the tiff capability had not been extended to printing panoramas. In seeking advice, I thought someone might refer me to an updating patch!
    Well done! You have confounded the system!  I could not find any control that would override the setting.

  • Firefox does not open, but instead gives the error message, "Failed to read the configuration file." It has worked in the past, but not now.

    Firefox does not open, but instead gives the error message, "Failed to read the configuration file." It has worked in the past, but not now.
    I REINSTALL 10 TIMES SO DON'T TELL ME THAT!!!
    I'm piss because i need firefox working again so i can finish reseaching my speech in 5 days.

    Which files do you have in the defaults\pref folder in the Firefox program folder?
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    See also "Other solutions":
    *http://kb.mozillazine.org/Preferences_not_saved
    Do a clean reinstall and delete the Firefox program folder before (re)installing a fresh copy of the current Firefox release.
    Download a fresh Firefox copy and save the file to the desktop.
    *Firefox 22.0: http://www.mozilla.org/en-US/firefox/all.html
    Uninstall your current Firefox version, if possible, to cleanup the Windows registry and settings in security software.
    *Do NOT remove personal data when you uninstall your current Firefox version, because all profile folders will be removed and you lose personal data like bookmarks and passwords from profiles of other Firefox versions.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure that "remove personal data" is NOT selected when you uninstall Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • JMF working on LAN but not over web !!

    Hai,
    I am doing project on virtual classroom. I need to stream video over the internet. My program works fine on LAN but doesn't work on net.
    My idea basically is to capture video from tutor and write the data to server pc's port (intermediator), so that student any where in the world can acess my server and its port to retrieve the live data.
    The MediaLocator for both sending and retrieving data (i.e tutor and student )
    MediaLocator m = new MediaLocator("rtp://192.168.1.253:23232/video/255");
    Please let me is there something wrong with my logic, with media locator or with my other part of program.
    I would be extremely gratified if someone would share some idea on streaming data over internet.
    Thanks in advance !!

    Then transmit to a broadcast address xxx.xxx.xxx.255I think works only on LAN. But my project works on internet.
    I have decided to drop my intermediator (server).
    Now I trying to work on direct communication between tutor (transmitter) and student (reciever). I can get two IP addresses of the student -
    1 : Internet Proxy server IP address, (e.g. 203.109.246.29) which is uniquely identified on internet.
    2 : Local IP address, (e.g. 192.168.1.23) which is valid on LAN.
    I provided media locator as rtp://203.109.246.29:23232/video/1. If the student's pc is internet outlet then student is able to see the video. But if the student is sitting on LAN with some other pc as proxy server then tutor will write the data to the proxy server (since the proxy server is uniquely identified on the internet and not the student's pc). My problem now is how data be tranferred from proxy server to student's pc??
    I feel like some broadcasting to be done on the LAN. I want to achieve it without having some program running on the Internet Proxy server.
    Regards

Maybe you are looking for

  • HT6546 How do you get podcast subscriptions to download on my iMac?

    I had several podcast subscriptions automatically downloading daily to iTunes on my iMac. When I installed Maverick they stopped and I can't find a way to get them started again. I looked for help on the iTunes site and all it talks about is in conne

  • Path/Shape tool and Hand tool are awful in CS6.

    We recently upgraded to CC at work and I do love the idea. Hypothetically, what could be better? Sadly, CC comes with CS6 which doesn't shine so well. Photoshop in particularl is hindering me and slowing down my productivity. Therefore I am sharing m

  • Output device not automatically determined in VF02

    Hello gurus, My default output device is not coming automatically when I add an output type in VF02. This is an issue because output type has requirement 62 set in output procedure, therefore it will not be added until invoice is release to accountin

  • Find the date range of a employee

    Hi all, I have table with data like this emp_id ename location from_date ===== ===== ===== ======= 1001 SCOTT USA 01-Jan-2013 1001 SCOTT USA 30-Apr-2013 1001 SCOTT USA 16-May-2013 1001 SCOTT USA 30-Jun-2013 1001 SCOTT USA 19-Aug-2013 1001 SCOTT USA 0

  • Compile errors using bpelx:append

    I'm getting compile errors from one particular bpelx:append. I have others earlier in the bpel code, and they seem to be passing the check. <bpelx:append> <from variable="set-panel-member" query="/client:set-panel-member"/> <to variable="setPanel_set