# TCP/IP problems...

**URL:** <https://forums.digi.com/t/tcp-ip-problems/9867>\
**Category:** Rabbit\
**Created:** [April 13, 2007, 10:33am UTC](https://forums.digi.com/t/tcp-ip-problems/9867 "2007-04-13T10:33:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franek](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@Franek](https://forums.digi.com/u/Franek)\
**Post date:** [April 13, 2007, 10:33am UTC](https://forums.digi.com/t/tcp-ip-problems/9867/1 "2007-04-13T10:33:20Z")

</div>

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(&amp;test_socket,0,inet_addr(cfg_serv_ip_addres),atoi(cfg_ip_port),NULL);
while(!sock_established(&amp;test_socket) &amp;&amp; sock_bytesready(&amp;test_socket)==-1)
	{
	if(!tcp_tick(&amp;test_socket))
		{
		Connected=0;
		LCDSetConnectStatus(Connected,OPQGetNpacks());
		abort;
		}
	yield;
	}
sock_close(&amp;test_socket);
while(tcp_tick(&amp;test_socket)) yield;
Connected=1;
host_test_on=0;
LCDSetConnectStatus(Connected,OPQGetNpacks());
waitfor(DelaySec(10));//Retry every 10 seconds
}

```

---

<div class="post-metadata">

**Author:** ![Franek](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@Franek](https://forums.digi.com/u/Franek)\
**Post date:** [April 13, 2007, 10:34am UTC](https://forums.digi.com/t/tcp-ip-problems/9867/2 "2007-04-13T10:34:33Z")

</div>

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);  
…

---

<div class="post-metadata">

**Author:** ![Franek](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@Franek](https://forums.digi.com/u/Franek)\
**Post date:** [April 13, 2007, 10:36am UTC](https://forums.digi.com/t/tcp-ip-problems/9867/3 "2007-04-13T10:36:49Z")

</div>

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