Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User wsh604's Avatar
    Join Date
    Dec 2007
    Posts
    31
    i would like to know how to send and receive a broadcast msg if there are several devices connected in the same network (for example network address, 192.168.0.0). Please help!

  2. #2
    Registered User wsh604's Avatar
    Join Date
    Dec 2007
    Posts
    31
    i use the code bellow to broadcast,but i find there isn't any packet sent at all!!!

    TInetAddr iAddrBroadcast;
    iAddrBroadcast.Input ( _L("255.255.255.255"));
    //iAddrBroadcast.NetBroadcast(iServerCommanderAddr2);
    iAddrBroadcast.SetPort ( 10300);
    iAddrBroadcast.SetFamily ( KInetAddrBroadcast); //
    iSocket->SendTo( iBuffer, iAddrBroadcast, 0, iStatus );

  3. #3
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    You should not tamper with SetFamily. Personally I have never set it or seen it to be set to anything (I think it is the task of the given TSockAddr descendant), and it is absolutely sure that KInetAddrBroadcast is an address, not an address family.

  4. #4
    Registered User wsh604's Avatar
    Join Date
    Dec 2007
    Posts
    31
    now i change my code as bellow ,and capture packets by tool wireshark ,and i find these isn't any packet been captued.
    TInetAddr iAddrBroadcast;
    iAddrBroadcast.Input ( _L("255.255.255.255"));
    iAddrBroadcast.SetPort ( 10300);
    iAddrBroadcast.SetFamily ( KAfInet); //
    iSocket->SendTo( iBuffer, iAddrBroadcast, 0, iStatus );

  5. #5
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    The constant appearance of line "TInetAddr iAddrBroadcast;" disturbs me, please confirm that it is actually a member variable.
    Also note that this request has a completion code, have you checked iStatus in your RunL?

  6. #6
    Registered User msa22's Avatar
    Join Date
    Aug 2007
    Posts
    14
    Just a minor comment: The "Input"-method already sets the address family correctly (you can use IPv6 addresses too). Using SetFamily should be omitted (it actually might mess up the work of Input method!).

Similar Threads

  1. carbide-error
    By upendersolanki in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 5
    Last Post: 2008-02-06, 11:09
  2. Problem with Cabride.c++ v1.1
    By markovuksanovic in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2007-01-24, 20:05
  3. Render FAX message and send it
    By jorge_c in forum Symbian C++
    Replies: 0
    Last Post: 2003-05-19, 11:32
  4. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46
  5. Send message to othet phone with 7650
    By ilnokia7650 in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-11-05, 12:36

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