eykolo

Giannis Papaioannou jhn at egnatia.ee.auth.gr
Fri Mar 24 20:39:45 EET 2000



On Fri, 24 Mar 2000, Nikos Mavroyanopoulos wrote:

> Oti an sou kleisei i grammi, tin p**t*ises :)

Well, o dikos mou client den einai toso oloklhromenos oso o dikos
sou alla kanei apsoga thn douleia tou. Egw phra to string apo ton
client ths xtreme, to ebala sto programmataki pou exw attachment
kai prin synde8w trexw xtreme, meta thn syndesh kai merika seconds
to programma kleinei kai epistrefei to prompt tou floiou. Ean kopei h
grammh apla to 3anatrexw prin 3anasynde8w (an kai den etyxe kati tetoio
mexri twra)

> H xtreme ap'oti eida, stelnei orismena paketa kai meta tin syndesi (den

yparxei ontws enas dialogos kyriws me ACKs alla krataei poly ligo
kai apo oti fainetai den xreiazete kai na ginei oloklhros, an sto mellon
xreiastei na oloklhronetai tote apla 8a pros8esw olh thn synomilia,
allwste den einai dyskolo na thn deis.

to pragmatiko symperasma einai oti h xtreme den mporei na kanei
tipota gia auto, mporw na sniffaro to mhxanhma mou ana pasa stigmh
na dw to stoixeiwdes protokolo epikoinonias kai na grapsw diko mou 
client.

-------------- next part --------------
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

#define X_STRING "bRn32q]8Z?d:g3g=ZHZ#dNdJgHY;cCf;Z#Y&[&c&`+_#_Gh1bKaDZ3^jhh[_[d\\_Zjbedh"
#define X_PORT 6699

int main()
{
  int socketfd, serverfd, slen, clen;
  struct sockaddr_in server_addr, client_addr;
  char x_buff;
  char x_string[]=X_STRING;

  if ((socketfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror("socket");
    exit(EXIT_FAILURE);
  }

  server_addr.sin_family = AF_INET;
  server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  server_addr.sin_port = htons(6699);
  slen = sizeof(server_addr);

  if (bind(socketfd, (struct sockaddr *) &server_addr, slen) < 0) {
    perror("bind");
    exit(EXIT_FAILURE);
  }

  if (listen(socketfd, 1) < 0) {
    perror("listen");
    exit(EXIT_FAILURE);
  }

    clen = sizeof(client_addr);
    if ((serverfd = accept(socketfd, (struct sockaddr *) &client_addr, &clen)) < 0) {
      perror("accept");
      exit(EXIT_FAILURE);
    }
    write(serverfd,x_string,strlen(x_string));
    while(read(serverfd,&x_buff,1))
      ;
    close(serverfd);

    exit(EXIT_SUCCESS);
}


More information about the Linux-greek-users mailing list