Need help badly- Keep getting error: connection refused.

I'm developing an online multiplayer game, and everytime I try to use the multiplayer capabilities I get this kind of error. I have created a mini-connection class just to test if my program is working right, and apparently not. I have not included disconnection object in the following classes, since they are unneccessary since I cannot connect in the first place. First I ran my Servertest.class, which runs up to "Waiting for Connection", then waits, then I ran my ClientTest.class, which always gives me the error at teh bottom of the page.
Please tell me what is wrong with the following-
import javax.swing.*;
import java.awt.*;
import java.util.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import java.net.URL;
import java.io.*;
import java.net.*;
public class Servertest {
private ObjectInputStream input;
private ObjectOutputStream output;
private ServerSocket server;
private Socket connection;
public void Servertest() {
public void runServer() {
try {
server = new ServerSocket( 12347, 100 );
System.out.print( "Waiting for connection\n" );
connection = server.accept();
System.out.print( "Connected to: " + connection.getInetAddress().getHostName() );
output = new ObjectOutputStream( connection.getOutputStream() );
output.flush();
input = new ObjectInputStream( connection.getInputStream() );
System.out.print( "\nGot I/O Streams\n" );
catch ( IOException ioException ) {
ioException.printStackTrace();
public static void main( String args[] ) {
Servertest application = new Servertest();
application.runServer();
import javax.swing.*;
import java.awt.*;
import java.util.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import java.net.URL;
import java.io.*;
import java.net.*;
public class ClientTest {
private ObjectInputStream input;
private ObjectOutputStream output;
private Socket client;
public void ClientTest() {
public void runClient() {
System.out.println( "Attempting Connection" );
try {
client = new Socket( InetAddress.getLocalHost(), 12348 );
System.out.println( "Connected to: " + client.getInetAddress().getHostName() );
output = new ObjectOutputStream( client.getOutputStream() );
output.flush();
catch (EOFException eofException) {
System.err.print( "Client Terminated Connection!" );
catch (IOException ioException) {
ioException.printStackTrace();
public static void main( String args[] ) {
ClientTest application = new ClientTest();
application.runClient();
When I run Server Test it shows: Waiting for Connection.
When I run Client Test is show the following:-
Attempting Connection
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:153)
at ClientTest.runClient(ClientTest.java:26)
at ClientTest.main(ClientTest.java:41)
Any help would be greatly appreciated!

Your server listens on port 12347. Your client tries to connect to a different port. No server is listening on the other port, so the connection is refused. Solution: make client connect to port 12347.

Similar Messages

  • Need help installing keep getting error message when i install program

    i download the beta version on my android epic phone by sprint and when i go to install the program it shows a screen installing then an error message pops up almost immediately and say that application was not installed how do i fix this i have tried to re-download it and install it again but it gives the same error message every time now i have also allowed outside markets apps to download on my phone and i still get this error message or what do i need to do to get it installed on my phone?

    Firefox might not be able to run on your mobile . See [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements System requirements for Android mobile] and [https://wiki.mozilla.org/Mobile/Platforms/Android#Known_Issues Known issues for mobiles]

  • HT3275 I need help.  Keep getting error message he backup disk image "/Volumes/Data/MacBook Pro.sparsebundle" is already in use.

    I keep recieving he following error he backup disk image “/Volumes/Data/ MacBook Pro.sparsebundle” is already in use.  for time machine backup.  Any suggestions

    It is standard for Lion and Mountain Lion.
    Reboot the TC to fix it.
    If you actually run Lion then you can install 5.6 utility and just go to the disk page and click disconnect all users.. this is usually enough to fix it.. on the previous backup TM hasn't dismounted the sparsebundle correctly and so cannot mount it again.
    See C12. http://pondini.org/TM/Troubleshooting.html

  • Why I keep getting Error: "Connection attempt has timed out, please verify internet connectivity". I'm using Windows 8.

    Why I keep getting Error: "Connection attempt has timed out, please verify internet connectivity". I'm using Windows 8. 

    Check the time and date, updates with apple' time servers
    https://discussions.apple.com/docs/DOC-3046

  • I have an older version of flash player in my new computer and I can't uninstall it it is system 32 and I have system 64 I am not much of a computer person and need help I keep getting pop ups saying there is a bad image

    I have an older version of flash player that seems to be in my computer_16_0_0_305.exe and it says bad image
    I could not uninstall it and put a new one in. I keep getting this pop up 2 and 3 times.

    Hi,
    The Flash Player installer is a universal installer for both 32 and 64-bit systems.  On a 64-bit OS, it installs both versions, on a 32-bit OS, it installs only the 32-bit version.  I'm confused by why you think you only have the 32-bit version.  Please provide more information, including screenshots (How to post a screenshot in the forum) so that we may further troubleshoot your situation.
    Thank you.
    Maria

  • 2011 15 in Mac Book Pro. Can't access help. Keep getting error message computer not connected to internet. But compute is connected to internet.

    When I try to access help in my 2011 MacBook Pro I get an error message that I'm not connected to the internet. But I know I am connected to the internet because I'm getting email and surfing the web at the same time. Any ideas?

    Firewall of some type blocking whatever port the help system uses?
    Router setting?

  • Please help! Keep getting error message "an internal error occurred"

    Hello,
    I'm trying to install Adobe Reader 10.1 on my macbook, but after (what looks like a successful download of Reader), when I try to open up a pdf I get the message "an internal error occurred." From here I am forced to click "OK" and then I just get a blank screen.
    I've tried to unistall and reinstall all Adobe files several times, but always get the same error message.
    Here's what I'm working with:
    Mac OS X - Version 10.5.8
    Intel Core 2 Duo
    Safari - Version 5.0.6
    I'm not super-tech savvy, I just need to download this program to be able to use an online training module for school.
    Thanks.

    Hello,
    I have had the same problem and ended up spending about 4 working hours resolving it, although I have a master degree in computer science.
    The problem is caused by an incompatibility between Adobe Acrobat Reader 6.0/7.0 and Adobe Acrobat Reader 10. It is very strange that this error was not discovered during Adobes in-house quality control. I expect such tests should have been performed prior to making new releases, in order to spare problems for users. Also, I would expect better error management in a software product of this calibre. If a missing file ends up causing a crash, one might wonder if there are also security critical flaws in the software related to e.g. parsing PDF documents.
    Problem description:
    After agreeing to the license Adobe Acrobat says "An internal error occurred" and crashes. No further information given.
    The system log reads ([…].com.adobe.Reader[220]) Exited abnormally: Interrupt
    Executing the binary directly from the terminal with -O flag gives no data on standard output. Other crash log reveals no interesting information.
    Solution:
    After some investigation, found crash is caused when /Users/[username]/Library/Application Support/Adobe/Fonts/AdobeFnt06.lst is accessed.
    Hence due to incompatibility between Adobe Acrobat Reader 6.0/7.0 and Adobe Acrobat Reader 10.
    The installer/uninstaller should probably have removed the file.
    I could delete the above file since I no longer use v6.0/7.0, and the problem was then resolved.
    Prior to this I had also deleted some of the com.adobe.* preferences from
    /Users/[username]/Library/Preferences
    /Library/Preferences
    etc.
    although I am not sure if this was necessary.
    Hope this helps.
    /Martin

  • In expert mode, using the mover tool, I can not move one picture into another. Need help as I get error message

    I have two pictures in expert mode in editor. I go to "Move tool", click on picture but I am unable to move and drop in second picture. I do not get the dashed lines around the picture, and if I move cursor to
    move picture, I get the following message " This operation cannot be performed on the locked background layer. Do you want to convert the locked background layer into an editable layer?"  I have no idea
    what I need to check or uncheck to make it work.,  I am following a lesson plan in a "Infinite Skills" training course.  I talked to them, but was unable to come up with a answer.  Help, please I have been
    trying to do this move for over a week.  tks  rdf

    We don't know whether this tutorial was written for Photoshop or Photoshop Elements, more specifically for which version of PSE. There are differences. Be sure to have the layers palette open.
    Try this instead
    Open picture B, the one you wish to select something from to add to another picture.
    Use one of the selection tools, e.g. selection brush, lasso tool, to select the object. You will see an outline ("marching ants") once the selection is complete
    Go to Edit menu>copy to copy the selection to the clipboard
    Open picture A, then go to Edit>paste
    Use the move tool to position object from picture B.
    In the layers palette you should see picture A as the background layer, and object B on a separate layer.
    To unlock the background layer, double click on it in the layers palette. Perhaps your tutorial will  guide you through the process.

  • Help i keep getting error 7 (windows error 14001) when opening itunes

    also it say itunes helper not installed correctly. I tried everything from uninstalling everything from itunes to reintalling any other suggestions?

    also it say itunes helper not installed correctly.
    I'd like to have a closer look at that error message please.
    Generate the error message again. While the error message box is open, hold down the Alt key and hit the PrtSc key. Paste the screenshot into an image file (using a program like Paint), and save the file.
    Start a reply here and click the wee camera icon at the top of the reply window. Click "Choose file", browse to the image file, select the file and click "Open". Now click "Insert file" to insert the screenshot into the reply.

  • TS3694 HELP. i keep getting error 3194 when trying to restore my iphone 4s

    any body know how to fix this problem??

    I seemed to have figured it out...... I hard reset my Iphone and rebooted my computer and it seemed to work. It also seemed there was a music file that was not being recognized, I just erased it and everything worked fine after that.... very strange but I am so glad I figured it out.....

  • HELP I keep getting an error message on my IPHONE 4 that says Unable to connect to Cellular Data. How do I fix this?

    HELP I keep getting an error message on my IPHONE 4 that says Unable to connect to Cellular Data and I have tried to reset network settings and factory reset but nothing helping so far. Took it to Verizon and they couldn't fix it either, said it's a problem with the phone itself and to contact Apple. My warranty is expired so Apple isn't much help either. How do I fix this? I have a data package so confused and I have had my phone for over a year but never had this issue before.

    I am getting this message also.... mine cant update too...

  • I have installed Adobe digital additions and have tried to aurthorize but keep getting error message "Connection error" . The internet connection is working and I do have an Adobe ID can you help please

    I have installed Adobe digital additions and have tried to authorize but keep getting error message "Connection error" . The internet connection is working and I do have an Adobe ID can you help please.
    I have been using Adobe reader for PC to download my eBooks but the eBook Vendor has switch to Digital Addition,

    this is from sjpt,
    Try completely removing any authorization using ctrl-shift-D to ADE (cmd-shift-D if on Mac).
    Restart ADE, and then reauthorize with your Adobe ID.

  • TS3694 trying to restore to factory default by keep gett error:code 3194 please help

    need to know hoe to restore to factory default ....keep getting error 3194

    Hi ratcat14!
    I have an article that can help you troubleshoot this issue:
    Resolve specific iTunes update and restore errors
    http://support.apple.com/kb/ts3694
    Check for hardware issues
    Try to restore your iOS device two more times while connected with a cable, computer, and network you know are good. Also, confirm your security software and settings are allowing communication between your device and update servers. If you still see the alert when you update or restore, contact Apple support.
    Common errors: 1, 10-47, 1002, 1011, 1012, 1014, 1000-1020.
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • I downloaded songs to my phone at xmas and when i plugged in to my laptop it wiped the phone of new purchases when i try and download them to my computer in itunes via previous purchesses it wont load the list and i keep getting error 10053 can any1 help

    i downloaded songs to my phone at xmas and when i plugged in to my laptop it wiped the phone of new purchases when i try and download them to my computer in itunes via previous purchesses it wont load the list and i keep getting error 10053 can any1 help

    Syncing shouldn't trouch you photos unless you have photos in a Photo Library album.  These would be photos that were synced to your phone from your computer.  If you do have any, you'll need to use an app like PhotoSync to transfer them to your computer prior to syncing.
    If you prefer to backup your camera roll photos prior to syncing, open iTunes and go to Preferences>Devices and check "Prevent...from syncing automatically".  Then connect your phone to your computer and import them as explained here: http://support.apple.com/kb/HT4083.
    Then, to minimize data loss, follow the steps in this user tip: https://discussions.apple.com/docs/DOC-3141.  To follow the steps, first open iTunes and go to View>Show Sidebar.  Also, Transfer Purchases is now located in File>Devices.

  • Keep getting error 1611on itunes help!!

    keep getting error 1611on itunes help!!

    Error 1611
    This error typically occur when security software interferes with the restore and update process. FollowTroubleshooting security software issues to resolve this issue. In rare cases, this error may be a hardware issue. If the errors persist on another computer, the device may need service.
    iTunes: Specific update-and-restore error messages and advanced troubleshooting

Maybe you are looking for

  • Recovery Disc Creator does not list any discs for creation

    Brand new NB200-10G (this a UK model). When I run TOSHIBA Recovery Disc Creator it does not show any discs for creation and the CREATE option is greyed out so I cannot create the discs. Now... when I first got it I did not have a USB DVD writer with

  • Unwanted duplicates when saving pdf's in Reader

    Compared to other problems, more of an inconvenience - but time consuming none-the-less: using Adobe Reader 10.1.1 Mac OS X Lion 10.7.2 (11C74): when I request to "save as" a pdf, Reader will save a duplicate copy - to both the location I specify (wi

  • Basic sql query

    Hi all, I am trying to get a report using sql, but I do not get the data out. Select data1, sum(data2) from table1 where date1 between '01-JAN-2007' and '01-JAN-2009' group by data1 I know I have data because the query runs in sql+ I do not get any e

  • Java client error - initPlugins NullPointerException

    I am writing my first java PAPI client and getting a NullPointerException when calling processService.createSession. I have included the following in my build classpath: ftlib.jar, ftpapi.jar, fuegocore.jar, Opta2000.jar And, I am including the follo

  • Recovery multi-layered .psd file

    Hi, I have a large .psd file 1.56 Gb 27000 x 7200 pixels. I've been able to save but Ps6 crashed (running OS X 10.8.3 SSD 8Gb RAM) and now I am getting the following message "Could not complete your request because the file is not compatible with thi