×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    31

    how to send a broadcast message

    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
    Join Date
    Dec 2007
    Posts
    31

    Re: how to send a broadcast message

    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
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: how to send a broadcast message

    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
    Join Date
    Dec 2007
    Posts
    31

    Re: how to send a broadcast message

    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
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: how to send a broadcast message

    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
    Join Date
    Aug 2007
    Posts
    14

    Re: how to send a broadcast message

    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
    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
  •