Home Help Center

how to pass binary char array to remote host efficiatively?

socketrefsocketref Member bin.zhangOrganization: sohuProject: Gps Navi Device
hi ICE-team:
i will attempt to pass char array ( char buff[1024]) to remote host via ICE enigine,in ICE ,must covert buff to sequnce<Byte>,it map to std::vector<Byte>,its capablity is not good at speed, i don't known how to resolve this problem.

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Please see this post regarding our support policy:

    http://www.zeroc.com/vbulletin/showthread.php?t=1697
  • socketrefsocketref Member bin.zhangOrganization: sohuProject: Gps Navi Device
    Dear Marc,Give me any advise

    :p:p
    Dear Marc,Give me any advise
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    You can only transfer a vector<Byte>, but not a byte array. In my experience, the overhead of a vector<Byte> is very small. For example, IcePatch uses vector<Byte>, too, and the speed equals that of FTP. You can also try the throughput performance tests in demo/Ice/throughput.

    If you measure performance, make sure to use optimization. The speed of STL containers depends a lot on inlining and other optimization features. In addition, STL containers also often have additional checks in debug mode that lower performance.
  • socketrefsocketref Member bin.zhangOrganization: sohuProject: Gps Navi Device
    very thanks!

    very thanks
  • socketrefsocketref Member bin.zhangOrganization: sohuProject: Gps Navi Device
    other

    in our application ,we will tranfer variant media stream(video/audio) from client to server,high-speed is important. in pass,we create raw tcp/udp socket at both side, push stream-bytes into socket .example:
    streambuff = new Byte[1024*10]
    sk = socket(AF_INE,SOCK_STREAM,0);
    ret = caputreVideoStream(streambuff,1024)
    ret = packRTP(streambuff,ret)
    send(sk,streambuff,ret,0);
    that's ok!
    and now if using vector<Byte>, i known ice also will implement above socket-operation,so i consider application cost is expansive.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    I'm not sure what exactly the question is. Is the question how to use vector<Byte> efficiently with raw sockets?
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    I think that the network overhead (ie: the cost in sending and receiving the data over TCP/IP) will make the application inefficiency you are referring too (essentially a memory allocation and data copy) totally insignificant. Have you measured a real difference in a real world application?
Sign In or Register to comment.