Link to home
Start Free TrialLog in
Avatar of BlackWolfNo1
BlackWolfNo1

asked on

Tcp Listen and send

Hello i´m trying to make a application that can communicate with a Control4 director.
They Way it works is like this.
My application connects to the Control4 director on port 5020 and send a command "enable events" wich makes the control4 unit send me any events that occurs to my local port that was oppened by the tcpclient (ex 54798) then i have tried to use a tcplistener to listen to all traffic sent by the control4unit. then if a where to send data again the localport changes. but i would like to keep listening on the same localport.
Dont know if this make sense but to simplify.
Send data to port 5020
then listen to the port autochossen by the tcpclient.
thereafter bieng able to send how many commands on port 5020 and still listen on the first autoselected port.

Any help would be helpfull.
Jonas
Avatar of Christopher Kile
Christopher Kile
Flag of United States of America image

Under what circumstances does the port you need to listen to change?
Avatar of BlackWolfNo1
BlackWolfNo1

ASKER

i dont know the listening port until i have sent a command to the control4 unit.
It listens to the port 5020 but when i send a command to it tcpclient autochoses a port it sends from and the control4 unti only responds to that port so when i cativate the "enabled events" that the control4 unti has it will send all events to the port wich i have sent dthe command from.

Does it make any sense?
Force the TcpClient to use a port of your choice, not its choice.  I know there is a method for doing so.  I will research it.
I have not found how i would be able to choose port to send on from tcpclient.
Have you?
Sorry for the long response, I've been out of the office for a week.  I will resume research and get back to you later today.
ASKER CERTIFIED SOLUTION
Avatar of Christopher Kile
Christopher Kile
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial