×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    100

    send bytes to initiate connections

    hello, I want to establish a connection and send me 24 bytes at the time you set it, like this:
    After you start the camera program waits at the camera port
    SERVER_PORT (port 2002) for a string RECIEVE_BYTES (24 bytes).

    This string includes the Following data:

    1. x position of the image (int value, 4 bytes)
    2. y position of the image
    3. dx
    4. dy
    5. incrx
    6. incry

    and I make the connection as follows:

    this-> conn-> connect (this-> ui-> lineEdit_2-> text (),
    this-> ui-> lineEdit-> text (). Toint ());
    how I can send those bytes to the time you establish the connection.
    thank you very much

  2. #2
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    100

    how to send an integer by a buffer

    How I can send one over for a buffer?
    thanks

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,563

    Re: how to send an integer by a buffer

    Look up the Qt documentation on QTcpSocket to send and receive data. QUdpSocket also exists, if you want to use UDP instead of TCP. See also QHttp, if you want to step up from the TCP socket level and use HTTP to send/receive data.

  4. #4
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    100

    Re: how to send an integer by a buffer

    i like send one integer

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,563

    Re: how to send an integer by a buffer

    It doesn't matter whether you wish to send an integer, float, a character, a text string, a picture, a video, some other file, or whatever; you still have to select yourself whether you use either TCP socket calls, UDP socket calls or HTTP calls. And, besides the client implementation that does the sending, you of course also must have a corresponding server that receives what you're sending. If the receiving server implementation already exists, then that will also determine how it expects the data to be sent, which presumably whomever created the server application has or can tell you.

  6. #6
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    100

    Re: send bytes to initiate connections

    I already I have implemented a tcp socket,
    sending text strings with it, but I want to send an integer.
    my code is this:

    void Client:: sendcabecera (QByteArray x, and QByteArray, QByteArray dx, dy QByteArray, QByteArray incx, incy QByteArray)
    {
    / / READ: If the socket connection is valid then send the message
    / / But make ASCII


    if (socket-> isValid ())
    socket-> write (x.toAscii ()),
    socket-> write (y.toAscii ()),
    socket-> write (dx.toAscii ()),
    socket-> write (dy.toAscii ()),
    socket-> write (incx.toAscii ()),
    socket-> write (incy.toAscii ());

    and call the function like this:

    this-> conn-> sendcabecera (this-> ui-> lineEdit_3-> text (). Toint (),
    this-> ui-> lineEdit_4-> text (). Toint (),
    this-> ui-> lineEdit_5-> text (). Toint (),
    this-> ui-> lineEdit_6-> text (). Toint (),
    this-> ui-> lineEdit_7-> text (). Toint (),
    this-> ui-> lineEdit_8-> text (). Toint ());

    It does not work

Similar Threads

  1. How to send Image on server in bytes?
    By SymbianTH in forum Symbian Networking & Messaging (Closed)
    Replies: 17
    Last Post: 2012-04-07, 05:10
  2. Send PDU mode SMS more than 140 Bytes
    By jengy in forum General Messaging
    Replies: 0
    Last Post: 2006-03-22, 14:12
  3. socket.send(bytes,callback)
    By sznever in forum Symbian
    Replies: 2
    Last Post: 2005-05-04, 15:12
  4. Replies: 5
    Last Post: 2003-06-09, 04:03
  5. How do I initiate POP3/IMAP4 mail retrieve and send?
    By mmalo in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2002-11-28, 11:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×