Hi,
just experimenting...
udp packet from machine 192.168.1.10 has ports (from WireShark dump):
User Datagram Protocol, Src Port: ds-user (4403), Dst Port: cbt (7777)

Machine 192.168.1.100 has Synapse receive socket port = 7777 and actually
receives and displays this packet.
What do i have in this packet that identifies the sender? IP = 192.168.1.10
and port = 4403.
And receivers GetRemoteSinPort gives me 4403, and i send reply with IP =
...10 and destination port 4403.
Echo reply:
User Datagram Protocol, Src Port: pwgpsi (3800), Dst Port: ds-user (4403)

But machine 192.168.1.10 do not know that it is supposed to accept packet
with destination port 4403. That is the problem!
I think windows Sockets is assigning those random numbers and Synapse is
not aware of them.
Mark, windows Sockets do not reject this packet with ICMP "destination port
unreachable", it thinks the Synapse application is a legitimate destination.

I tried GetLocalSinPort on the sender machine in a hope that it will give
me this random 4403 port number.

For now sender is incapable to receive echo, unless i specify some fixed
port for answers, but that would not be echo then.



On Sat, Mar 10, 2012 at 2:28 AM, Jorge Aldo G. de F. Junior <
jagf...@gmail.com> wrote:

> For sure you dont want to use getlocalsinport... this will say YOUR
> local port not the remote one. You should use GetRemoteSinPort instead
> to get the other end port...
>
> And if this fails yet, try calling getsins before reading the packet.
>
> 2012/3/9 Dmitri Tsvetikov <dmitri.tsveti...@gmail.com>:
> > Thank you Lukas,
> >
> > i implemented your suggestions,
> > now UDP_TxRx app. can receive messages (in a listening thread) from
> > identical application on another computer.
> >
> > Next i tried to convert it to Terminal and Echo app.
> > Echo works like this:
> > Term sends packet:
> > Internet Protocol Version 4, Src: 192.168.1.10, Dst: 192.168.1.100
> > User Datagram Protocol, Src Port: ds-user (4403), Dst Port: cbt (7777)
> >
> > Echo app. receives this packet, displays and sends it back switching
> source
> > and destination ports like this:
> > Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.10
> > User Datagram Protocol, Src Port: pwgpsi (3800), Dst Port: ds-user (4403)
> >
> > Terminal do not see this message, because it listens on the wrong port
> > number.
> >
> > How can i get source port number of the sent packet (in Terminal app.)?
> > I tried this:
> >     SndSock.Connect(edSndSockIP.Text, edSndSockPort.Text);
> >     if SndSock.LastError <> 0 then exit;
> >     Caption := Caption + ' ' + IntToStr(SndSock.GetLocalSinPort);
> >     SndSock.SendString(edStr.Text + #13#10);
> >     Caption := Caption + ' ' + IntToStr(SndSock.GetLocalSinPort);
> > It returns 0. I was hoping to get something similar to 4403.
> >
> > Because this is the port that is supposed to listen for echo message.
> >
> > How to receive this echo packet?
> >
> > Best regards,
> > Dmitri
> >
> >
> >
> > On Mon, Mar 5, 2012 at 11:29 PM, Lukas Gebauer <gebyl...@mlp.cz> wrote:
> >>
> >> > Returned packet seems in order. Is it possible that Synapse is just
> >> > dropping the packet because there is something wrong? Could this
> option
> >> > be
> >> > turned off temporarily?
> >>
> >> 1. Do not use "rcvsock.ConvertLineEnd := true;" on non-stream sockets.
> >>
> >> 2. Call of CreateSocket is not needed. Socket will be created
> automaticky
> >> by Synapse.
> >>
> >> 3. call of "sndsock.Bind('0.0.0.0', '0');" is not needed too. It is
> >> default value.
> >>
> >>
> >> --
> >> Lukas Gebauer.
> >>
> >> http://synapse.ararat.cz/ - Synapse Delphi and Kylix TCP/IP Library
> >> http://geoget.ararat.cz/ - Geocaching solution
> >>
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Try before you buy = See our experts in action!
> >> The most comprehensive online learning library for Microsoft developers
> >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> >> Metro Style Apps, more. Free future releases when you subscribe now!
> >> http://p.sf.net/sfu/learndevnow-dev2
> >> _______________________________________________
> >> synalist-public mailing list
> >> synalist-public@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/synalist-public
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Virtualization & Cloud Management Using Capacity Planning
> > Cloud computing makes use of virtualization - but cloud computing
> > also focuses on allowing computing to be delivered as a service.
> > http://www.accelacomm.com/jaw/sfnl/114/51521223/
> > _______________________________________________
> > synalist-public mailing list
> > synalist-public@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/synalist-public
> >
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> synalist-public mailing list
> synalist-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/synalist-public
>
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to