TCP/IP problems...

OK, I’m using DC 9.01 under Windows NT 4.0 (such is life), and have the next piece of code (inside a main.c with some other points of connection to host, but this one is enough as an example).

So… tcp_open is not working; tcp_tick is not working. No connection is established with the host. Neither here, neither in the rest of analogue parts of the code with ticks, opens and closes…

Host IP is well-defined, client IP, port number, gateway and netmask are, also. In the host I have a program running, listening to the socket in the right port, and it has proved to work with already compiled clients, which are able to send and receive packets to/from the host.

What can happen?

costate{		//test HOST avaliability
while(analisis_error) yield;
host_test_on=0;
while(OPQGetNpacks()||host_conec_on||only_local) yield;
host_test_on=1;
tcp_open(&test_socket,0,inet_addr(cfg_serv_ip_addres),atoi(cfg_ip_port),NULL);
while(!sock_established(&test_socket) && sock_bytesready(&test_socket)==-1)
	{
	if(!tcp_tick(&test_socket))
		{
		Connected=0;
		LCDSetConnectStatus(Connected,OPQGetNpacks());
		abort;
		}
	yield;
	}
sock_close(&test_socket);
while(tcp_tick(&test_socket)) yield;
Connected=1;
host_test_on=0;
LCDSetConnectStatus(Connected,OPQGetNpacks());
waitfor(DelaySec(10));//Retry every 10 seconds
}

You can see, this is performed in the beginning section of the main:


sock_init();

tcp_config(“MY_IP_ADDRESS”,cfg_ip_addres);
tcp_config(“MY_NETMASK”,cfg_net_mask);
tcp_config(“MY_GATEWAY”,cfg_ip_gateway);

Oh, and another (good?) hint yet: DC 9.01 sample programs, such as ping.c, dns.c or dns2.c, are not working, neither…