TCP server in DHCP mode

Hi!
I’m developing a project of a TCP server that can work with static IP or get the IP from DHCP.
In static IP it works fine, but in DHCP, it gets the IP but it returns error in the function listen(sn).
Since DHCP uses UDP protocol is possible to use this IP on TCP protocol?
I have already tried to use other socket on TCP protocol but it didn’t work too.
Anyone could help on how to configure the Wiznet as a DHCP client and a TCP server?
Thanks.

Why not?

You must give more details - IP address you get from DHCP, mask, gateway address, MAC address.