socks programming
Results 1 to 3 of 3

Thread: socks programming

  1. #1
    Member
    Join Date
    Jan 2003
    Posts
    37

    socks programming

    Hi people; i've been doing some soket programming; yet i got stuck; i was wondering if anybody could help me.
    I can conect to hosts with the connetc( ) ; and recv() from them; yet; when i send() sth; the server does not respond to me.
    I am trying to log into a POP server; i connect to it and recive the welcome page; yet when i send user Myuser; i get no response.
    I think i'm missing the EOL; which would it be is '\n' fine?
    myu script after recieveing the welcome screem go sotheing like:
    send(sockfd, "user myuser'\n'" (in fact i use a cahr array here but it's the same), arraylength, 0);
    is the EOL wrong; because i believe that my command is not being intepreted by the server.
    Well I hope someone can help me...
    thanks.
    ampm2003.
    \"Aclaró que un Aleph es uno de los puntos del espacio que contiene todos los puntos\"... (An Aleph is a point in space that contains every point)
    Jorge Luis Borges \"El Aleph\"...

  2. #2
    Senior Member
    Join Date
    Jul 2002
    Posts
    339
    You didn't tell us, you're using what language in what platform. Anyway, POP3 daemon commands must be ended by CR (hex 0d, dec 13) LF (hex 0a, dec 10) sequence. Taken from RFC 1939:
    Commands in the POP3 consist of a case-insensitive keyword, possibly
    followed by one or more arguments. All commands are terminated by a
    CRLF pair. Keywords and arguments consist of printable ASCII
    characters. Keywords and arguments are each separated by a single
    SPACE character. Keywords are three or four characters long. Each
    argument may be up to 40 characters long.
    Try
    send(sockfd, "user myuser\n", arraylength, 0);
    not
    send(sockfd, "user myuser'\n'", arraylength, 0);
    don't quote the \n .

    Just make sure the string ends with CRLF.

    Peace always,
    <jdenny>
    Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
    I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds


  3. #3
    Member
    Join Date
    Jan 2003
    Posts
    37
    Thanks jdenny you are my saviour; it worked just fine when I added the string you told me i should cat at the end of my string...
    \"Aclaró que un Aleph es uno de los puntos del espacio que contiene todos los puntos\"... (An Aleph is a point in space that contains every point)
    Jorge Luis Borges \"El Aleph\"...

Posting Permissions

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