#1025 Socket method recvFrom should set address

4.1.1
closed
Classes (182)
none
5
2013-11-22
2011-09-20
Ol'Jo
No

The SockRecvFrom() function returns the senders address in the stem variable, but the recvFrom() method of the Socket Class contained in socket.cls doeas not return the senders ipddr and port due to missing code.
ooRexx Version 4.1.0
Windows Vista Home Basic SP2
Correction in socket.cls should look like:
...
::method recvFrom
expose s errno
use strict arg len, address
if len~datatype('W') = 0 then raise syntax 93.905 array (1, len)
if len < 1 then raise syntax 93.907 array (1, len)
if \address~isA(.InetAddress) then ,
raise syntax 93.914 array (1, 'an InetAddress', address)
stem. = address~makeStem()
retc = SockRecvFrom(s, 'xxx', len, 'stem.!') --- changed from ... 'stem.')
if retc = -1 then do
errno = self~convert_err_number(SockSock_errno())
return .nil
end
address~family= self~convert_address_family(stem.!family) --- inserted
address~address=Stem.!addr --- inserted
address~port= Stem.!port --- inserted
if retc = 0 & xxx~length > 0 then do
errno = self~convert_err_number(SockSock_errno())
if xxx~length > 0 then return xxx
else return ''
end
else errno = ''
return xxx

...
...

Discussion

  • David Ashley

    David Ashley - 2011-09-22

    Fixed in SVN commit 7156.

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-07-16

    The fix for this item was in the 4.1.1 or 4.1.0 release.

     
  • Rick McGuire

    Rick McGuire - 2013-11-22
    • Pending work items: --> none
    • Group: v4.2.0 --> 4.1.1
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks