Socket = CreateObject ("roStreamSocket")
Port = CreateObject ("roMessagePort")
Buffer = CreateObject("roByteArray")
Buffer[65536]=0
IP = CreateObject("roSocketAddress")
IP.SetPort(####)
IP.SetHoneName("www.????????.com/....")
Socket.setSendToAddress (IP)
Socket.Connect()
if Socket.IsConnected()
Socket.NotifyReadable(true): Socket.NotifyWritable(true): Socket.NotifyException(true): Socket.SetMessagePort (Port)
while true
Event = Port.GetMessage()
StepBackgroundTasks()
if type(Event)="roSocketEvent" and Socket.IsWritable()
Socket.SendStr(...whatever to send...)
exit while
end if
end while
Offset=0
Bytes=-1
while Bytes<>0
Event = Port.GetMessage()
StepBackgroundTasks()
if type(Event)="roSocketEvent" and Socket.IsReadable()
Buffer[Offset+Bytes]=0
Bytes=Socket.Receive(Buffer,Offset,65536)
Offset=Offset+Bytes
end if
end while
Socket.Close()