[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem with winsock client/server URGENT! 500pts

Posted on 2006-06-10
13
Medium Priority
?
244 Views
Last Modified: 2010-04-05
Hi guys

K heres the problem i created a program that uses a server[as server] and clients to connect to it...

setup:

[PC1][PC2][ PC3][Server]
  |       |        |       |
   \      |        |      /
     \    |        |    /
       \  |        |  /
[ADSL Modem ROUTER]
               |
          Internet

K i use port 2000 as my port for the programs server/client, on my Computer everything works fine, its when i take it to clients that i cant seem to get the clients to connect to the server or visa versa (like the diagram above)

The Server client is run on the server
            *PROBLEM*
      PC1-3 connects to server

I have let port 2000 open TCP/UDP on all the machines server and client, but it still wont connect...
When windows firewall pops up and asks, unblock i click unblock...

Q: Is there something that im missing in order to connect these PC's together over IP

Im using D7 XPSP2, standard delphi sockets
0
Comment
Question by:Scay7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 1000 total points
ID: 16876794
I'm sure you know all this stuff, but I'll post it just in case.
Check your ADSL configuration, you probably need to setup NAT (network address translation/pinholing)
eg, when i run a server behind my router, i would open up port 2000 on the modem, directing all incoming calls on port 2000 to my server's local ip address.

You may also need to allow port 2000 in your modem's firewall
You may also need to allow port 2000 in your computer's firewall

for "me" to talk to your server, I need your "internet ip" , not your local network ip, or your router's ip, but the ip address assigned to your modem when it connects to the internet
go to http://whatismyip.com/ to see what that might be
this is the address you need to tell your clients to try to connect to.

for testing, disable all firewalls, (pcs and modem) and see if you can connect. if you can, turn them on 1 by 1 to see where the block is.

Another problem you can get is if both you and the client are behind firewalls, but this should not be a problem for a simple "connect" as in your case.
I'll have a think and post more once I get some caffeine
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876803
K same problem :

PC1 = Server;
PC2 = Client;

K now there is no modem acting as router, just a plain HUB connecting all the pcs together and the modem connected to that HUB giving all the pc's internet

Im not connecting to the SERVER through the internet... just PC1 trying to get to PC2 both firewalls OFF and its still wont connect...

Scay7
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876806
Oh also forgot to mention

PORT on Client and SERVER = same
Client connects to SERVERs  TCP IP

eg : Client = 10.10.10.100
      Server= 10.10.10.1

Subnet masks = ALL 255.255.255.0
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16876895
so the client ping the server successfully?
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876912
ye they can ping each other...
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16876920
try telnet from the client to the server
start- run- cmd.exe

telnet 10.10.10.1 2000
type test commands
(ctrl-c to quit)
does that work? if so, check your client code, and make sure it is not hardcoded to "localhost' ;-)
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876964
ClientSocket1.Address := edit8.Text; //server ip
 ClientSocket1.Port := 2000; //port
 clientsocket1.Open; //open

Telnet works
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16877109
if the client can't connect remotely, you must be getting an error. what error do you get on the client? (10054, 10061, etc)
do you have a short 'connect timeout' set?
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16877118
some other possibilities.
no tcp installed on the client pc :-)
anti-virus (some are quite promiscuous)
0
 
LVL 5

Author Comment

by:Scay7
ID: 16877809
- K i got the error code from them : 10061
- No timeout just doof cant connect
- TCP installed and working
- Plain antivirus without firewall, using windows firewall...
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16879377
if telnet is working from the client, and you do not have a firewall/av active that is specifically blocking your application, then it must be the code in the project
i think I have it :-)

Set ClientSocket1.Host
not ClientSocket1.Address
0
 
LVL 5

Author Comment

by:Scay7
ID: 16973309
"eg, when i run a server behind my router, i would open up port 2000 on the modem, directing all incoming calls on port 2000 to my server's local ip address."

I think this is the problem... how do i set a billion ADSL modem to

send data from pc's to server
and
send data from server to pc's

I have a basic idea, about NAT...

Sorry for the time gap, had other pressing matters aswell :P

Peace Scay7
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17068778
I really mean it :-) have you tried setting the "host" property instead of the "address" property

aside from that.
you only need to set up the adsl NAT on the server's ADSL modem, not the clients
adsl modem's and routers allow most "outgoing" connections unless they have set up a specific rule denying it
it is only the server that needs the pinhole, so I don't think this is yuor problem.
Let me know if the "host" porperty fixes it or not


0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question