Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Strange connection issues,

Discussion in 'Connected Games' started by Christian-Tucker, Oct 23, 2013.

  1. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    373
    Alright, so I don't really understand what is going on, before anyone goes to point out that it has to do with "Port Forwarding" or a "Firewall exception", I'd like to state that you're wrong. I don't have any type of fire-wall running and my ports are forwarded correctly.

    I recently picked up the SmartFox Server, and started to mess around with it, however once I wanted to test it over the internet, everything started falling apart, when they tried to connect to me via my IPv4 address, they could not..

    Now, I had to think back a bit, but I did figure out it wasn't a port problem, I tested port 9933 and it was working fine, however I changed the SmartFox Server to listen for TCP/UDP on port 5555, which also didn't do anything for me, so, I went ahead and wrote a very, VERY basic BARE-BONES back end, to see what was going on

    (This is a java back-end, basic server)

    Code (csharp):
    1. import java.io.IOException;
    2. import java.net.ServerSocket;
    3. import java.net.Socket;
    4.  
    5.  
    6. public class Main implements Runnable {
    7.  
    8.     ServerSocket _serverSocket;
    9.     Socket _socket;
    10.    
    11.     public Main() {
    12.         try {
    13.             System.out.println("Starting Server");
    14.             _serverSocket = new ServerSocket(5555);
    15.         } catch (IOException e) {
    16.             System.out.println("Startup Failed");
    17.             e.printStackTrace();
    18.         }
    19.     }
    20.    
    21.     public void run() {
    22.         while(true) {
    23.             try {
    24.                 _socket = _serverSocket.accept();
    25.                 String connectingHost = _socket.getInetAddress().getHostName();
    26.                 System.out.println("Connection from " + connectingHost);
    27.             } catch (IOException e) {
    28.                 e.printStackTrace();
    29.             }
    30.         }
    31.     }
    32.  
    33.     public static void main(String args[]) {
    34.         new Thread(new Main()).start();
    35.     }
    36. }
    37.  
    Alright, so I'm running this server, now I try to connect locally using my Unity3D application and I receive the following message from the server:

    Great, so I have connected locally, so I attempted to connect using my Ip address, 50.**.**.110

    Alright, so it's obviously connecting and I'm not getting any connection errors on the unity side, so does anyone know what's going on? I've spent the last 2-3 hours learning how to use Smart-Fox server, and although I don't have a detailed understanding of it yet, I'm proud of what I've accomplished on a "localhost" scale and would like to branch it outwards.
     
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,685
    Can you explain this sentence, not sure what your doing here:
    First you state that it worked on 9933 and then you say that it also doesn't do anything on 5555 ?
    Also not that testing on localhost and the internet are different things but a simple telnet on the TCP port should give some info.
     
  3. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    373
    Better explained, SmartFox by default listens on port: 9933
    The server that I wrote up was listening on port: 5555

    After realizing that I could connect to the basic server that I wrote that listened on port: 5555 I set SmartFox to listen on Port: 5555, which in result still didn't do anything (Couldn't connect/locate the server)

    After that, I changed my custom server to listen on port: 9933 instead of 5555, and I could still connect, this was my testing to ensure it was not a port related issue.
     
    Last edited: Oct 24, 2013
  4. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,685
    Are you using the WebPlayer? And if you are using it, are you prefetching the policy?
     
  5. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    373
  6. foxter888

    foxter888

    Joined:
    May 3, 2010
    Posts:
    530
    are you using unity free or pro?
     
unityunity