Re: [twsocket] Sending video data via UDP

2005-05-07 Thread Francois PIETTE
  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;

--
[EMAIL PROTECTED]
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


Re: [twsocket] Sending video data via UDP

2005-05-06 Thread Dan
- Original Message - 
From: Magno Lima [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Friday, May 06, 2005 8:18 PM
Subject: [twsocket] Sending video data via UDP


Hi List!
I will repost a email I sent to Francois, of course it is for everybody:
I am trying to send video from a point to another, using UDP. Francois 
told me about the UdpSend/UdpLstn demo, and I conclude with:

The UdpSend/Lstn demo generates an error here (ListenBackLog Property 
does not exist), but I can read all the source. There you use a buffer as 
string. I am getting data from a video capture and I will transmit it by 
UDP (video broadcast), I receive a video_buffer that has about 20Kb of 
size (per second), so I need send that.

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
If you're using UDP the maximum packet size, and so the maximum size you can 
use in a send call is about 65KB, but be sure to set TWSocket's bufsize 
property.
As for ListenBackLog, I'm not sure, can you just ignore the error?
Did I answer the right question, I'm not entirely sure what you're asking...

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?
There is a winsock function, and the WSocket unit has a wrapper for it, 
called something like inet_addr.  That will get you the IP, and you will 
also want htons when assigning the port (to convert from host byte order to 
network byte order).


Sorry if my doubts are very basic, but I am learning about your component 
and I ever sent video via internet :)
That's it... :)
Good luck :)
Dan 

--
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