![]() |
| | #1 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 229
| Client-server on a LAN I have been testing with some manuals and tutorials about winsock (also winsock2, but for the moment I use the synthax explained on winsock1), till I create a basic server and a basic client. On the same PC they work great, server listens on port 80, accept connections through 'INADDR_ANY', and client can connect to the server as 'localhost' or as '127.0.0.1' (the localhost IP, I think that's the localhost IP because there's only one aliases on the IP's aliases list). Till that point all is right. But now I would like to run the server on a PC and the client on another: I'm right supposing that both 2 PC connected on the same router is a LAN? On the net connections attributes ('start->config->net connections->LAN connection', I'm not running english windows version , that's a literal translation so I suppose that the names will be similar) appears a tab control for the LAN compatibility, and it says Code: On PC #1 IP adress : 172.16.0.4 On PC #2 IP adress : 172.16.0.5 On both there's the same "subnet mask : 255.255.255.0" and the same "predefined bla bla (sorry, I' don't know how to translate that) : 172.16.0.1" On both PC's, when I run the server and client on the same PC, altought the IP adress is 172.16.0.x I should use the localhost IP that is 127.0.0.1 (for both PC's). Finally I try to run the server on on PC #2, the client on PC #1, but it does not work. If I use the localhost IP (127.0.0.1, or whatever variant 127.0.0.x) the client gets an error 10061; if I try to connect the client to the IP adress of the PC#2 (172.16.0.5) I get an error 10060; if I try to connect to the subnet mask the error is 10049. I have the same errors if I run the server on PC #1 and the client on PC #2. How can I solve that problem? Or where can I find more info about that? Thank's in advance Niara |
| Niara is offline | |
| | #2 |
| Yes, my avatar is stolen Join Date: Dec 2002
Posts: 2,544
| You can find a list of winsock error codes here. You are correct to use the IP address of the server computer (172.16.0.5). Firstly make sure you can ping the other computer (run the command ping 172.16.0.5). Other than that make sure you don't have other firewall software that could be blocking the connection. |
| anonytmouse is offline | |
| | #3 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 229
| Hello anonytmouse, thank's for your time. I'll take a look on your recommendations and post back the results. Niara |
| Niara is offline | |
| | #4 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 229
| Hey, that works!!! I have find that the problem was me and my settings of the windows firewall; when I run the server program, the firewall asks for what to do with the connections: block all, no block never, or ask before. I thought that "ask before" was similar to "allow that run, but ask what to do in new program runnings". Finallly I have done the next: on PC #2 with SP2, I start the server, a windows alert asks me for block/non block the server so I tell it no block it never. Now I can continue my work. More thank's anonytmouse for your help. Niara |
| Niara is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| server client application - (i really need your help) | sarahnetworking | C Programming | 3 | 03-01-2008 10:54 PM |
| Client works on a LAN but don't send all the data | Niara | Networking/Device Communication | 9 | 01-04-2007 04:44 PM |
| Where's the EPIPE signal? | marc.andrysco | Networking/Device Communication | 0 | 12-23-2006 08:04 PM |
| Unicode vurses Non Unicode client server application with winsock2 query? | dp_76 | Networking/Device Communication | 0 | 05-16-2005 07:26 AM |
| Client timed-out once on connect(), can never connect() again | registering | Networking/Device Communication | 6 | 10-28-2003 03:46 PM |