Switching from client to server

I am conecting to a server SRVR as a client CLNT using “wip_TCPClientCreate()”…once its connected to server SRVR, I am sending the ip address and port number of client CLNT to server SRVR… and immediately switching from client CLNT to server SRVR2 I am expecting the server SRVR to connect to SRVR2(previously clinet CLNT) as clinet CLNT2…

The flow is as follows,
1.CLNT -> SRVR(wip_TCPClientCreate)
2.Send CLNT’s IP Address & Port number to SRVR(wip_write).
3.Close CLNT(wip_close)
4.create SRVR1(wip_TCPServerCreate)
5. SRVR -> SRVR1 as client(WIP create command)

Note: No timer or delay used in process… pls help me y the second part i.e SRVR -> SRVR1 not working.

Thnx in advance

this is propably because your modem is not reachable from the internet (you dont really want that.)

Why do you want to set up a server on the modem side?

because the PC should connect to thousands of such modems in field. for simulation purpose I am using two modems , but one side it will be PC and it should connect to modem(server) like client as it can handle thousands of such modem(server) together.

What does wip_TCPServerCreate returns? Can you write your wip_TCPServerCreate function here? And make sure that on pc side, your firewall doesnt blocks the port which modem listens to. So your connection to modem through that port will not be blocked.

you should really look into implementing a client on the modem instead of a server.
from your opening post i conclude that your modems will be initiating the connection anyway.
so there’s no need to let the pc connect back to the modem as there is already a connection there!

A server on the modem will require a special type of data-subscription. Normally mobile operators won’t allow connections being made from the internet to your modem.
(unless you want that special data-subscription)