Connection from a specific port


i am using fastrack supreme 663g, wip 3.0

simply i send some data to a server with the following flow:

// connect gprs (ip address: modemIP)
Handle_ChannelClient = wip_TCPClientCreate(destinationIP,destinationPort , EventHandler_ChannelClient, NULL);

when i monitor the logs on the destination side, i see the modem connecting server with the port 1024.
what I see is = remote end point-> modemIP:1024 , local end point-> destinationIP:destinationPort

i understand this log as modem connects to serverIP:serverPort through the 1024 port. How can i change the 1024? So that i can connect through the a specific port.

What do you supose that the destinationPort parameter does… :question: :question:

To make it clear;

there is a port redirector (ISA server on windows 2003) on the server whose ip address is destinationIP. and the server makes redirection to port destinationPort (3000) from any ports. At this point there is a problem. We dont want the server to redirect from any ports. we want to redirect to port 3000 from port i.e. 1000.

when monitoring the incomming and outgoing connections on the server, we see that modem connects with the ip address of modemIP and the port of 1024. So we have to redirect from 1024 to 3000. But we can not change 1024 while the modem connects always through this port.

Do we search the problem on a wrong side? isnt there anything to do with the modem side? Does 1024 mean anything to us? i am not sure about these. So your ideas can make us better to understand the stuation.

As awneil wrote using function wip_TCPClientCreate you have to set up destination IP and destination port parameters.
If you will set up destination port to value 3000 your modem should, or better, will connect your server using this port.
Redirecting ports on server is different thing and is not related to any Wavecom features. You should read your port redirector manual.

thank you for your answers. i think i m missng some places. as you say the parameter i suppied must be the port to be connected. i will look in details.

thanks alot

That is completely and utterly irrelevant to the modem!

The modem connects to the IP address and Port Number that you specify as the parameters to wip_tcpClientConnect; it makes absolutely no difference whatsoever to the modem how your server may subsequently forward or translate the connection - that is entirely invisible to the mode (or to anything else that might connect to that IP address & port).
It is entirely an internal matter within your own network.

Think of it like call diversion on a phone: the whole point of that is that the caller does not need to know anything about the diversion - all they know is that they dial your number and, eventually, it gets routed through to you. The details of the routing, and what phone you might evetually use to pick up the call are entirely irrelevant to the caller.

right awneil. thank you for the explanation. it is more clear to me now.

I think what you’re missing is an understanding of TCP/IP networking in general - irrespective of GPRS and/or Wavecom.

Take a look at this tutorial: … otocol.htm

Or, indeed, any tutorial or book on TCP/IP networking