sending n no of char data uning send() function,

This is a discussion on sending n no of char data uning send() function, within the Windows Programming forums, part of the Platform Specific Boards category; I am working on a Winsock programme which should send data in a array, which contains 26 no of characters(a ...

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    9

    Smile sending n no of char data uning send() function,

    I am working on a Winsock programme which should send data in a array, which contains 26 no of characters(a to z), to the connected remote socket in several attempts.
    Condition is.... I only need send 4 characters per attempt to the remote socket. So it should reads first 4 characters from begin (1st character to 4th character ) of the array and send it to remote socket, then again next 4 characters (from 5th to 8th) and send it. This should needed to continue until the array get finish.

    Ex:
    if array[26]="abcdefghijklmnopqrstuvwxyz";

    In the first attempt, it should send "abcd" to remote socket
    In the second attempt, it should send "efgh" to remote socket and third "ijkl" etc,.
    In the last attempt t should send "yz" (because no of characters are 26 if 26/4 = 6 and extra 2) to the remote socket.

    I can write winsock code for initialize the socket [WSAStartup() function], create socket, bind it [bind() function] and connect to remote socket using connect() function.
    I only need help from there to onward, reading 4 charactores from array[26] and send those using send() function according to the above described way.

    Pls be king enough to help me for this...

    Regards
    thebrighter

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,802

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  2. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  3. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 09:18 AM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Strings are V important...
    By NANO in forum C++ Programming
    Replies: 15
    Last Post: 04-14-2002, 11:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21