Trouble connecting sockets...

hi.
i'm trying to connect to sockets over the internet but everytime i used my computers domain name when setting up the socket on the clients side they do not connect , here is the code im using:
server
ServerSocket serversocket = null;
Socket clientsocket = null;
try {
serversocket = new ServerSocket(4444);
clientsocket.accept();
catch (Exception e) { }
client
Socket clientsocket = null;
try {
clientsocket = new Socket("mydomain", 4444);
catch (Exception e) { }
I'm testing these using the same computer and the only way it will connect is if i use my computers name which is "Craig" as the domain name but when i tested it on two computers it never worked
???

here is my full source codes for my server and client progs:
client:
import java.net.*;
import java.io.*;
public class client {
public static void main(String[] ags) {
Socket clientsocket = null;
try {
clientsocket = new Socket(InetAddress.getByName(""), 6795);
System.out.println("Connected");
catch (Exception e) {
System.out.println("error occured: " + e);
server
import java.net.*;
import java.io.*;
public class server {
public static void main(String[] args) {
ServerSocket serversocket = null;
Socket clientsocket = null;
try {
serversocket = new ServerSocket(6795);
System.out.println("Adding new socket to port 6795");
System.out.println("waiting for client...");
clientsocket = serversocket.accept();
System.out.println("connected");
catch (Exception e) {
System.out.println("error occured: " + e);
???

Similar Messages

  • Im having trouble connecting my macbookpro to the tv. im using a mini display port to hdmi adapter, when i switch tv/video to hdmi on the tv nothing pops up, and i dont have the arrangement tap on the display settings, please help!

    im having trouble connecting my macbookpro to the tv. im using a mini display port to hdmi adapter, when i switch tv/video to hdmi on the tv nothing pops up, and i dont have the arrangement tap on the display settings, please help!

    I've found that the order of operations, so-to-speak, can be important when hooking up mini display port to HDMI.  I have the most success with the following operations in this order:
    1)  Plug HDMI cable into mini displayport adapter (the cable should not be plugged into either the TV or the computer at this point)
    2)  Plug the mini displayport end of your new super-cable to the computer.
    3)  Plug the HDMI end into your TV.
    4)  Switch inputs on your TV to the proper input.
    5)  If still nothing on the TV, try a different HDMI port on your TV.
    Hopefully this helps!  Good luck.

  • Trouble connecting macbook to N600

    We just connected a E2500-NP using a macbook.  All of our other devices (iphone, itouches, nexus, PC) connect and run at regular speed.  My macbook (the one used to install the router) connects but loads web pages incredibly slowly.  We reinstalled the old router to see if there was a problem with the macbook.  It loads webpages at normal speed with old router.  The nexus and itouches have trouble connecting with old router.  The macbook is connected to this website with no problem but if I try to do a search on something else it loads incredibly slowly.
    Please help!!

    How did you connect the macbook computer? Is it through hardwired or wireless connection? You can adjust the router’s mtu – by using this link: http://kb.linksys.com/Linksys/ukp.aspx?vw=1&docid=fbf8e8564632422eaa8ea80bf9dcba64_386.xml&pid=80&re... – if the concern is regarding the router’s hardwired connection. You can also use this link: http://www.metageek.net/products/inssider/ to help determine the best channel to be set on the router and to improve the router’s wireless performance.

  • Trouble Connecting MacBook to Netgear WGT624

    Hello, I just got a MacBook and am having trouble connecting to my netgear WGT624 wireless router. We've had the router for some time with a PC connected via ethernet. This is the first time trying to connect wirelessly.
    I click on System Preferences.
    Then Network.
    Then Connect.
    Under the Network drop down menu, I have two Network choices available...our router's name, and another name, probably a nearby wireless router.
    When I choose our router, I get the pinwheel thingy spinning around, and then a message: "There was an error joining the AirPort network "router name here."
    When I click on the other nearby network name, I get connected, and the signal strength is 4 out of 15.
    What do I need to do to connect to my home's wireless router?

    No need to re-install software. There should be a reset button or hole somewhere on the router. Either press the button or use a paper clip inside the hole for about 10 seconds. This should reset your router to all the default settings.
    From there, once you log onto your router's setup screen, you will need to put in your regular settings (username, password, security settings, etc.). If you use security, your neighbor should not be able to access to your wireless connection.
    Good Luck.
    G4 400   Mac OS X (10.4.7)   MacBook

  • I am having trouble connecting to my network all of a sudden. It is not an issue with the service/router. I keep getting kicked off and getting a ! in my airport... anyone know what's up with this?

    I am having trouble connecting to my network all of a sudden. I am able to connect to other networks but not my own. It is not an issue with the service/router because other devices connect fine. I keep getting kicked off and getting a ! in my airport. Last time it happended I called apple and the suggested I wipe my HD and reinstall everything. I did and it did not work. One day I turned my laptop on and it connected no problem. Now it has kicked me off again. I tried resetting my IP address but that does not work either! Has anyone had this problem?

    Try this:
    Apple menu / System Preferences / Network.
    Click Location: and select Edit Locations..
    Click + (plus sign), and enter a name for the new location - anything will do.
    Apply this.

  • My new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

  • I'm having trouble connecting my iphone to my itunes on my computer

    So for christmas I got an iPhone and currently, I'm having trouble connecting my iPhone to my iTunes on my computer. If I get on my computer and open my iTunes, I can use it perfectly fine but once I tried to connect my phone to it, it told me the software needed to be updated before it would work with my phone. I went to the website and tried downloading the updated version 10 times but every time it told me it couldn't connect with an apple device or something. So then I tried just going to my downloads and stuff and moving the actual song straight to my phone but it would always tell me my device has ended or has been disconnected. All I'm trying to do is move some songs onto my phone from my computer. They weren't purchased straight from iTunes so it's not showung up in my "purchased" on my phone. (I think I got them from amazon and some are cds that I my computer that I got years ago. Maybe thats why they don't show up in the purchased?) Anyway, how can I fix this? I have a windows computer if that can help at all. Thanks!!!

    Also, I just opened my iTunes on my computer then plugged my phone to the computer and a box popped up saying "This iPhone cannot be used because the Apple Mobile Device is not started"
    I have no idea what that means.
    I don't have that option on the side that says what device is connected so I can't sync or anything.

  • Howto send outsream to more than one connected socket at the same time?

    Hi,
    I have a Serversocket socket class which is waiting for connections at a static port. The following code creates the ServerSocket:
    ServerSocket servsock = new ServerSocket(port);
    Then Im wating for clients to access to the server. I do it in a while loop like this:
    while(true){
    client = servsock.accept();
    System.out.println("New client connected");
    After that a put the connected client to e "Temp" variable:
    Socket temp = client;
    Then I Start a new Thread for that client and put it in a Vector:
    Thread v = new Thread (new Visitor(temp,this);
    visitor.add(v);
    v.start();
    } //end of while loop
    The class Visitor implements Runnable and have the constructor:
    public Visitor(Socket sss, MyServer server){
    s= sss;
    In the run method I create the output and input streams like this:
    OutputStream outStream           = s.getOutputStream();
    PrintWriter out               = new PrintWriter(outStream,true);
    InputStream instream           = s.getInputStream();
    BufferedReader appletIn      = new BufferedReader(new InputStreamReader(instream));
    After that Im Starting to Listen in a While loop:
    String line = appletIn.readLine();
    Now to my question: I want to send this "line" to all connected sockets using my vector visitors in my Server class.
    Can I have a method call in my Visitor class that call a method in my Server class? And how can I Iterate over all the elements in the Visitor and in each loop send a outStream to that connected socket?
    Thanx for all help I can Get!
    Best Regards Greeger!

    To send data from the from input stream to the output stream of multiple other sockets, you need to read data from the input stream, then send the same data to each of the output streams.

  • Trouble connecting new iMac to exisiting PC/Linksys network

    I just bought a new iMac and am having trouble connecting to my existing Linksys wireless network. My PC connects wirelessly fine, and the iMac connects if I use the Ethernet connection. However, it says I have "Incompatible Security" when I try to use the built-in Airport wireless connection.
    My network is WEP encrypted. I use one of the encryption keys for my PC. I was using 10 128-bit hex. Is there anything special or unique I need to do for the Mac? For example, for the Mac do I also use the 10 or 26 character key, or just the "Passphrase" (as described by Linksys)? Searching the net, I have found old posts suggesting I need to use quotation marks or $ sign in front of the key, but that advice seems outdated.
    BTW - I am having the same problem with my new iTouch.
    Your help is appreciated.
    null

    Thanks for posting back when you found the solution.
    Just to close things up as to why this would be a problem:
    WEP allows for 4 different keys to be configured. Key 1 is used to encrypt the data sent out from the device (either client or access point). When data is received, either of Keys 1-4 can match what is received.
    Since OS X only uses Key 1, if Key 1 on your access point doesn't match, it won't be able to decrypt anything that the access point sends back.
    The other keys are very rarely used.

  • I had trouble connecting my External hard drive

    I had trouble connecting my External hard drive (My passport WD) with my macbook. It worked before but not now. The external hard disk is blinking and is spinning but just not showing up on my computer. I tried looking in disk utility and no theres no sign of the disk showing up.
    Any help would be greatly appreciated!

    Yes, I saw a post on one of these threads about a powered USB hub so I ran over to Office Depot and picked one up.  I was finally able to see the HD in the Airport Utility.  Yay! 

  • I have updated my 4s iphone to ios 6.1.3 and have trouble connecting it to wi fi . i tried to back up it on itunes and then restore it but now i have left with a phone that still doesnt connect to wi fi and  lost all my data. anyone knows how to fix it?

    i have updated my 4s iphone to ios 6.1.3 and have trouble connecting it to wi fi . i tried to back up it on itunes and then restore it but now i have left with a phone that still doesnt connect to wi fi and  lost all my data. anyone knows how to fix it?

    If no change after restoring the iPhone with iTunes as a new iPhone or not from the backup, there is a hardware problem.

  • Running Toolkit - Cannot connect socket to port

    Hi,
    Can anybody help me to try and execute any program with the J2ME Toolkit. After loading the jad file from the samples I get the following error. This happens irrespective of the application I try and the applications do run on the Nokia toolkit I have installed. The error is as follows:
    Running with storage root DefaultColorPhone
    Cannot connect socket to port 3279
    Windows error code 10061
    Cannot open socket for LIME events on port 3279
    I am running Windows XP Pro, JSDK1.4.2.
    Thanks for your help.
    Sean Mac

    when i run the j2me toolkit 21 get the following message and the device disapears after a second...
    cannot connect socket to port 1047
    Windows error code 10061
    cannot open socket for LIME events on port 1047
    plzzz reply

  • I'm having trouble connecting to apps, itunes store, internet on my iPhone 5 running iOS 7.0.4.  I am currently connected to a perfectly running WiFI connection.  Why am I not able to connect anything?  I've tried ALL the fixes suggested.  HELP!!!!!!!!!

    I'm having trouble connecting to apps, itunes store, internet on my iPhone 5 running iOS 7.0.4.  I am currently connected to a perfectly running WiFI connection.  This just started happening today (2/19/14)!  Why am I not able to connect anything?  I've tried ALL the fixes suggested.  HELP!!!!!!!!!  BTW, I know my Wi-Fi connection is good because I'm using it on my desktop and other people in my office are also connected on their iPhones and desktops.  Again, HELP!!!!

    You may not really be connected to your WiFi network.
    Your router may not have given your iPhone a valid IP address. Go to Settings > Wifi > your network name and touch the "i" to the right to see the network details. If the IP address starts with 169 or is blank then your router didn't provide an IP address and you won't be able to access the Internet.
    Sometimes the fix can be as simple as restarting your router (remove power for 30 seconds and restart). Next, reset network settings on your iPhone (Settings > General > Reset > Reset network settings) and then attempt to connect. In other cases it might be necessary to update the router's firmware with the latest from the manufacturer's support web pages.
    If you need more help please give more details on your network, i.e., your router make, model and version, the wifi security being used (WEP, WPA, WPA2), etc.

  • My 13" early 2011 macbook pro is having trouble connecting back to internet after going to sleep. before updating to EFI 2.7 it was perfect now after updating its gone bad

    My 13" early 2011 macbook pro is having trouble connecting back to internet after going to sleep. before updating to EFI 2.7 it was perfect now after updating its gone bad.

    Same issue here too.  I will try reinstalling the firmware update.  This has happend to me twice.  The only way to correct the issue was to reboot.
    Thanks!

  • I am having trouble connecting MacBook Pro (10.6.7) to Novell server. I get incorrect username and password message. I can connect worksations running 10.5 without any problem. Any possible solution? Thanks, Ned

    I am having trouble connecting MacBook Pro (10.6.7) to Novell server. I get incorrect username and password message. I can connect worksations running 10.5 without any problem. Any possible solution? Thanks, Ned

    Having the exact same problem with connecting ML and Snow Leopard machines to a Windows 8.1 machine. Oddly enough, connecting and copying to/from works perfectly from a Mavericks machine, despite the problems reported about Mavericks regarding the exact opposite. An old thread, but did you find a solution?

Maybe you are looking for

  • Access is Denied -- Site Upgrade Upgrade from Foundation 2010 to Foundation 2013

    I'm trying to do a Site Upgrade from Foundation 2010 to 2013 and I keep getting Access Denied during the site upgrade process This is the error I keep seeing: Inner Exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) He

  • White Screen Safari 2.0.4

    We have developed a framed application and are having trouble with the content showing up in the main frame. The screen appears but is completely white. If you view the source, the content is all there. If you click anywhere on the screen, the page p

  • Macbook pro to pioneer kuros????

    I need help displaying my mbp onto my tv. I have a intel mbp hooked up via dvi to hdmi cable to an hdmi port on the back on a denon 3808 reciver. From there the image should be displayed on to the pioneer....and it is, sort of. I can see my backgroun

  • Java Photo Gallery

    Buenas, alguien sabe si en Java hay alg�n gestor de �lbumes de fotos parecido a Coppermine (PHP) ??? Estoy trabajando con JAlbum pero busco algo m�s din�mico, donde los usuarios puedan colgar ellos las fotos desde un interfaz web. Saludos y gracias H

  • Delinking A/R downpayment invoices from incoming payments

    Dear all, Is there a way to delink an A/R downpayment invoice from an incoming payment? Kind regards, Monil