> But how do I fill the TSockAddr structure to pass to SendTo?

Out of my head, not tested:

    FDest : TSockAddrIn;
    Data : AnsiString;
    MyPort : Integer;

    MyPort := 1234;  // Port number
    FillChar(FDest, SizeOf(FDest), 0);
    FDest.sin_family      := AF_INET;
    FDest.sin_port        := WSocket_htons(MyPort);
    FDest.sin_addr.s_addr := WSocketResolveHost('www.borland.com').s_addr;
    WSocket1.SendTo(FDest, SizeOf(FDest), PAnsiChar(Data), Length(Data));

The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to