comp • gb.net • udpsocket

UdpSocket (gb.net)

This class allows Gambas programs to communicate using UDP sockets.

It can be used like a server or client, as each data fragment sent or received is identified with its host IP and port.

This class inherits from Stream class, so you can use standard stream methods to read, write and close the socket.

This class inherits Stream in gb.
This class is
Creates a new UDP socket.
creatable
.

Properties

Methods Events
Returns or sets if the stream is blocking.
Blocking  
Return or set if the UpdSocket will broadcast its packets.
Broadcast  
Returns or sets the byte order used to read or write binary data to the stream.
ByteOrder  
This property signals whether the last use of LINE INPUT reached the end of file, instead of reading a full line with an end-of-line character.
EndOfFile  
Returns or sets the newline separator used by this stream.
EndOfLine  
Returns the system file descriptor associated with this Stream.
Handle  
Return or set the IP address the UDP socket will be bounded to.
Host  
Return if a stream is associated with a terminal.
IsTerm  
Returns a virtual object that allows you to enumerate a stream line by line.
Lines  
Return or set the udp socket path for local sockets.
Path  
Return or set the port number used for binding the UDP socket.
Port  
Return the source IP address if the message comes from the internet.
SourceHost  
Return the source path if the message comes from a local socket.
SourcePath  
Return the source port if the message comes from the internet.
SourcePort  
Returns the status of the socket, as a constant of the Net class.
Status  
Returns or sets the tag associated with the stream.
Tag  
Define the target IP address if the message goes to the internet.
TargetHost  
Define the target path if the message goes to a local socket.
TargetPath  
Define the target port if the message goes to the internet.
TargetPort  
Return a virtual object that allows to manage the terminal associated with the stream.
Term  
Return or set the timeout of the socket, in milliseconds.
Timeout  
Start to buffer data written to the stream, so that everything will be sent when the Send method is called.
Begin  
Bind a socket so the object can start sending and receiving data.
Bind  
Closes the stream.
Close  
Drop the data that has been buffered since the last call to the Begin method.
Drop  
This method is used to peek information from remote host(s).
Peek  
Read a line of text from the stream, like the LINE INPUT instruction.
ReadLine  
Send all the data, in one shot, since the last call to Begin.
Send  
Start or stop watching the stream file descriptor for reading or writing, after it has been opened.
Watch  
This event raises when some failed (for instance socket binding failed). Status property will turn to a value lesser than zero, and socket will be automatically closed.
Error  
This event raises when some data arrives to the socket from a remote host.
Read