realbasic-nug
[Top] [All Lists]

Re: Servers, Ports and scratching me head

To: realbasic-nug@lists.realsoftware.com
Subject: Re: Servers, Ports and scratching me head
From: Fabian Rueger <fabian@ruegers.net>
Date: Thu, 26 Feb 2009 21:13:28 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <mailman.8286.1235693497.5686.realbasic-nug@lists.realsoftware.com>
References: <mailman.8286.1235693497.5686.realbasic-nug@lists.realsoftware.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Thanks Charles, thanks Joe.
Below is the code from the AddSocket() event of the serversocket. Joe, if I understand you correctly there is no point in me setting the port of the added socket, even though they should be listening on that port?

-----------
AddSocket()

  dim ns as GameboardSocket
  ns=new GameboardSocket(MyGame)
ns.Server=true 'telling the socket that it is operating on the _serverside_
  if ThePrefs.CurrentlyUsedConfig isa ServerConfigurationSet then
    ns.Port=ThePrefs.CurrentlyUsedServerConfig.PortUsed
  else
    ns.Port=ThePrefs.DefaultServerConfig.PortUsed
  end if
  ns.Listen

  Return ns

----------

Notes on the code:
Gameboardsocket is a subclass of EasyTCP sockets;
MyGame is a custom class; so is all the Config stuff.
The only thing I see here is that I set the ports - could that be a cause, besides not explicitly setting maximumConnections to 10? (even though it is set to 10 according to a str (Serversocket.Maximumconnections) messagebox in the open event of the window where it's used which I just tested.) BTW I also had the server write a system.debuglog line for every created socket, and he does create 10 on startup, as expected.

If you're telling me this should all work I'll run another test with my overseas users and we give their firewalls a closer look again. It might not be RB after all.


Yes. In reality, each of the incoming connections gets handed off to a different port; you can see this by inspecting the Port property of your EasyTCP's. But the listening always happens on the server port, and you can receive any number of connections (up to the maximum you specify) on
that same port.

Cheers,
- Joe




From: Charles Yeomans <charles@declareSub.com>
...
Would you post your code from AddSocket()?

Charles Yeomans


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>