I use SignalR
hub as self-hosted on a windows service. There are winforms
clients which talk to the hub. The server runs on port 80 and it is working fine.
What I'm wondering is, on which port the client sends or receives the messages?
As far as I know the port we leave the client machine and the port we arrive at server are or can be different ports. The machines my client will run on will be short on ports(most ports are closed), so I'm thinking I need to predefine the port my client leaves the machine too.
- Am I right thinking like this?
- How can I create the connection on client side that client port is always same?
Here is my client code:
IHubProxy _TextCopierHub;
HubConnection _HubConnection { get; set; }
public TextCopierHub ( string url )
{
_HubConnection = new HubConnection(url);
_TextCopierHub = _HubConnection.CreateHubProxy("TextCopierHub");
_HubConnection.Credentials = CredentialCache.DefaultCredentials;
if ( !_HubConnection.Start().Wait(10000) )
throw new TimeoutException("Hub didn't start in 10 seconds");
RegisterEvents();
}
note: I am not able to simulate the client environment, hence I'm not even sure this will be a problem or not, but I don't want to surprise when we install the clients since the customer has pointed this requirement out.