All pastes #69016 Raw Edit

Mine

public text v1 · immutable
#69016 ·published 2006-06-22 12:02 UTC
rendered paste body
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define DEST_IP   "69.55.233.83"
#define DEST_PORT 24000

int recvv(int sockfd) {
int revc(int bytes_get, int sockfd, void *buf, int len, unsigned int flags);
char *buf;
int len, bytes_get;

len = strlen(buf);
bytes_get = get(sockfd, buf, len, 0);
return bytes_get;
}

main()
{
    int bytes_get;
    int sockfd;
    struct sockaddr_in dest_addr;   // will hold the destination addr

    sockfd = socket(PF_INET, SOCK_STREAM, 0); // do some error checking!

    dest_addr.sin_family = AF_INET;          // host byte order
    dest_addr.sin_port = htons(DEST_PORT);   // short, network byte order
    dest_addr.sin_addr.s_addr = inet_addr(DEST_IP);
    memset(&(dest_addr.sin_zero), '\0', 8);  // zero the rest of the struct

    // don't forget to error check the connect()!
    connect(sockfd, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr));

recvv(bytes_get);
return 0;
}