TCP client Application issue

瀏覽次數:30 次
跳到第一則未讀訊息

mahdie

未讀,
2016年12月7日 清晨6:20:312016/12/7
收件者: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

未讀,
2016年12月7日 下午5:37:022016/12/7
收件者: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

未讀,
2016年12月9日 凌晨3:53:512016/12/9
收件者: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

未讀,
2016年12月10日 清晨6:01:532016/12/10
收件者: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?
回覆所有人
回覆作者
轉寄
0 則新訊息