Client-server on a LAN

This is a discussion on Client-server on a LAN within the Networking/Device Communication forums, part of the General Programming Boards category; Hello, I'm trying to explore the basics of networking. Let me introduce my working zone: 2 PC (both with Windows ...

  1. #1
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287

    Client-server on a LAN

    Hello, I'm trying to explore the basics of networking. Let me introduce my working zone: 2 PC (both with Windows XP, one with SP1 and the other with SP2), both connected to the same router.
    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"
    Well, now I run the server on PC #2 (that PC have SP2, and it says 'Would you like to block...?", I say "Don't block my server") I test in local mode with the client and it works, so I can confirm that the SP2 allow me to work with servers and clients.
    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

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    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.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287
    Hello anonytmouse, thank's for your time. I'll take a look on your recommendations and post back the results.
    Niara

  4. #4
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. server client application - (i really need your help)
    By sarahnetworking in forum C Programming
    Replies: 3
    Last Post: 03-01-2008, 09:54 PM
  2. Client works on a LAN but don't send all the data
    By Niara in forum Networking/Device Communication
    Replies: 9
    Last Post: 01-04-2007, 03:44 PM
  3. Where's the EPIPE signal?
    By marc.andrysco in forum Networking/Device Communication
    Replies: 0
    Last Post: 12-23-2006, 07:04 PM
  4. Unicode vurses Non Unicode client server application with winsock2 query?
    By dp_76 in forum Networking/Device Communication
    Replies: 0
    Last Post: 05-16-2005, 07:26 AM
  5. Client timed-out once on connect(), can never connect() again
    By registering in forum Networking/Device Communication
    Replies: 6
    Last Post: 10-28-2003, 02:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21