Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User velund's Avatar
    Join Date
    Jun 2009
    Posts
    47
    Hi.

    I using RecvFrom method to read data from socket. As i understand TSockAddr &anAddr parameter should give me remote address... I receive the packet, but remote address is always empty.

    code example: iSocket.RecvFrom(iBuffer, iRemoteAddr, iFlag, iStatus);

    What can be the problem?

    Thanks in advance.

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    This line in itself looks fine (assuming that everything is a member variable). Do you apply any special flags?
    Otherwise, just to make sure: is this question about UDP or something else?

  3. #3
    Registered User velund's Avatar
    Join Date
    Jun 2009
    Posts
    47
    Yes, I'm talking about UDP and iFlag is set to 0(Anyway couldn't find possible values for this parameter). I'm not connecting the socket to specific remote address, so i suppose i should get this address from RecvFrom... Is there any other way to get remote address?

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    How do you check the address you get? If you happen to use TInetAddr::Output, make sure that the buffer you pass is at least 32 (or 40?) characters long. Due to some bug the method checks for suitable descriptor-length for an IPv6 address, even if you are using IPv4.

  5. #5
    Registered User velund's Avatar
    Join Date
    Jun 2009
    Posts
    47
    RecvFrom takes TSockAddr and not TInetAddr. TSockAddr inherited from TBuf8, so i treat as a descriptor.

  6. #6
    Registered User velund's Avatar
    Join Date
    Jun 2009
    Posts
    47
    Wow. In documentation RecvFrom receives only TSockAddr, but there is undocumented function that uses TInetAddr))) I tried it and it's worked)

    Thanks for the tip.

  7. #7
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    I do not know what undocumented function you mean, but TInetAddr is a TSockAddr:
    Quote Originally Posted by SDK Help
    class TInetAddr : public TSockAddr;
    Note that most (all?) descendants of TSockAddr also have Cast methods for "creating" specific address types from generic TSockAddr.

  8. #8
    Registered User velund's Avatar
    Join Date
    Jun 2009
    Posts
    47
    Quote Originally Posted by wizard_hu_ View Post
    I do not know what undocumented function you mean, but TInetAddr is a TSockAddr:Note that most (all?) descendants of TSockAddr also have Cast methods for "creating" specific address types from generic TSockAddr.
    Ok,ok. My fault.

Similar Threads

  1. how to get remote IP address for TCP connection
    By stonejustek in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2009-07-13, 03:01
  2. How to read remote device's bluetooth address
    By liuvictor2005 in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2008-03-17, 06:03
  3. Binding to Remote IP address Fails with -1
    By girish_1978 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-08-08, 20:36
  4. Binding to Remote IP address Fails with -1
    By girish_1978 in forum Symbian C++
    Replies: 0
    Last Post: 2006-08-04, 20:29
  5. Replies: 2
    Last Post: 2004-07-27, 07:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved