The port is missing.
DestAddr.sin_port := WSocket_htons(YourPortNumber);

--
[EMAIL PROTECTED]
http://www.overbyte.be


----- Original Message ----- 
From: "Magno Lima" <[EMAIL PROTECTED]>
To: "ICS support mailing" <[email protected]>
Sent: Monday, May 09, 2005 10:57 PM
Subject: Re: [twsocket] Sending video data via UDP


> Hi!
> 
> I removed the old ICS and with the new one its all working now. But I am 
> trying to send some data and something is not working here :( I made a 
> little procedure like:
> 
> procedure 
> SendUDP(Socket:TWSocket;Dest:string;Data:Pointer;DataSize:integer);
> var
>     DestAddr : TSockAddr;
> begin
>           FillChar(DestAddr, SizeOf(DestAddr), 0);
>           DestAddr.sin_family      := AF_INET;
>           DestAddr.sin_addr.S_addr := WSocket_inet_addr(PChar(Dest));
>           Socket.SendTo(DestAddr, SizeOf(DestAddr), Data, DataSize);
> end;
> 
> from where I call it, ie:
> 
> SendUDP(WSocket1,'192.168.1.1',@mydata,sizeof(mydata));
> 
> and No data is sent! :( If I use Socket.SendStr('..') the server receives 
> the data ... seems something wrong when transforming the ip address because 
> when I use Send() method, it worked.
> 
> Regards,
> 
> Magno
> 
> ----- Original Message ----- 
> From: "Francois PIETTE" <[EMAIL PROTECTED]>
> To: "ICS support mailing" <[email protected]>
> Sent: Saturday, May 07, 2005 4:41 AM
> Subject: Re: [twsocket] Sending video data via UDP
> 
> 
> >> > The UdpSend/Lstn demo generates an error here (ListenBackLog Property
> > does
> >> > not exist), but I can read all the source.
> >
> > It is likely you have an old wsocket.pas or wsocket.dcu somewhere. Check 
> > you
> > installation and be sure to delete every old file version. Use the latest
> > version from my website.
> >
> >> > The question is, I suppose to use TWSocket.Send(buf,size) ok? Will the
> > udp
> >> > stack take control over the 20Kb I am trying to send? How do I control
> >> > that
> >
> > You must set TWSocket.BufSize to the largest packet you want to send. By
> > default, it is 1460 bytes which is the largest TCP packet on Ethernet.
> >
> > Note that WinSock may fragment you packets depending on the hardware 
> > layer.
> > You have no control about it. It may also limit the maximum packet size to
> > some limit depending on the implementation. Also no control about that.
> >
> >> Other question is, there is the SendTo(Addr,buf,size) method, maybe I
> > should
> >> use that, but is there any easy function to convert the normal dotted IP
> >> address (127.0.0.1, ie) to the 'sockaddr_in' type?
> >
> > Use WSocket_inet_addr function (not a method of the component, a simple
> > function).
> > Something like:
> > var
> >    DestAddr : TSockAddr;
> > begin
> >    FillChar(DestAddr, SizeOf(DestAddr), 0);
> >    DestAddr.sin_family      := AF_INET;
> >    DestAddr.sin_addr.S_addr := WSocket_inet_addr('192.168.1.1');
> >    WSocket1.SendTo(DestAddr, SizeOf(DestAddr), Data, DataSize);
> > end;
> >
> 
> 
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
> 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to