TCP client Application issue

30 views
Skip to first unread message

mahdie

unread,
Dec 7, 2016, 6:20:31 AM12/7/16
to OMNeT++ Users
hello

How can I change my destination address of tcp socket when simulation running?

In my tcp client app an algorithm runs and chooses the best server for his work, then it should send it's packet to this server. when the simulation starts the connect function of tcp socket runs and make a new socket for the src and dst port and address. but how can I change this dst address at simulation time?


thanks for your help.

Alfonso Ariza Quintana

unread,
Dec 7, 2016, 5:37:02 PM12/7/16
to omn...@googlegroups.com

The same that the first, but before you need to close the previous session before that you create the new session


De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de mahdie <msha...@gmail.com>
Enviado: miércoles, 7 de diciembre de 2016 12:20:31
Para: OMNeT++ Users
Asunto: [Omnetpp-l] TCP client Application issue
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

mahdie

unread,
Dec 9, 2016, 3:53:51 AM12/9/16
to OMNeT++ Users, aari...@hotmail.com
thanks for your help.

I do that but there is another error. In my simulation I have multiple nodes connecting to one server at same time. after running simulation and sending some packets i recieve this  error! "Address already in use: there is already a connection listening on server address:server port.

error.png

mahdie

unread,
Dec 10, 2016, 6:01:53 AM12/10/16
to OMNeT++ Users, aari...@hotmail.com
I have another question.
I should close the socket befor sending new packet in sendRequest function? or closing by setting server close parameter to true in the packet? or closing the socket from server side after sending the reply message?
Reply all
Reply to author
Forward
0 new messages