Sending a banner using sockets

This is a discussion on Sending a banner using sockets within the Networking/Device Communication forums, part of the General Programming Boards category; Hi there, I have a banner.c that when I run it I choose a word and it transforms that word ...

  1. #1
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187

    Sending a banner using sockets

    Hi there,
    I have a banner.c that when I run it I choose a word and it transforms that word into a banner.
    I have managed to talk with other computers following beej.us guides but thing is those guides only get me connected to 'em and being able to send a phrase or a word.

    I'm trying to send a full banner now, what do you think I should be doing ?

    Thanks.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,499
    The only difference between sending 1 byte and sending a megabyte is a for loop.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    I understand what you're saying but I'm talking about different stuff.

    What I'm saying is I run :

    Code:
    ./banner ted
    And it outputs me a banner.
    I need to send the output, how can I do that ?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,499
    Like I said, can you do
    ./banner ted
    and just print the results on stdout?

    If you can do
    write(1,buff,strlen(buff));
    in some kind of loop, to make your banner appear on screen

    Then this is a cake-walk.
    write(sockfd,buff,strlen(buff));
    where sockfd is the socket you opened to the remote machine.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    Ah, okey I finally got it working
    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sending a file across sockets.
    By mushy in forum C Programming
    Replies: 23
    Last Post: 10-05-2010, 10:02 AM
  2. Need help with sending an int via sockets.
    By pheeze in forum C Programming
    Replies: 5
    Last Post: 11-10-2009, 01:03 PM
  3. sending structures through sockets
    By sunjayc99 in forum Networking/Device Communication
    Replies: 4
    Last Post: 07-01-2008, 07:43 PM
  4. Sending Hex to sockets?
    By chrisjmoss in forum Networking/Device Communication
    Replies: 1
    Last Post: 04-03-2008, 05:50 AM
  5. sockets and a "banner" scan
    By Tuborgrules in forum Networking/Device Communication
    Replies: 10
    Last Post: 01-19-2006, 10:19 AM

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