Thread: Sockets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Sockets

    Hey all, haven't been to the board in awhile but I have a question on sockets.

    I've made a server where a telnet client can telnet to on port 3550, everything works fine. Now I want to extend it so it logs all activities so I made it create a file and put in it:

    IP:[ip] connected to the server.

    One thing that doesn't work is the [ip] part.

    Code:
    inet_ntoa(client.sin_addr.s_addr);
    Isn't this supposed to go from machine order to usual ip number with dots?

    Well I did this and it gives me an error saying:

    Code:
    conversion from 'u_long' to non-scalar type 'in_addr' requested
    Second thing I want to add to the logging is date and time but I've never found out how to use those functions so if someone could help me out on that that would be great!

    Thanx very much for any help you may be able to offer me.

    [Devouring One]
    Last edited by devour89; 05-29-2003 at 03:37 AM.
    Dev C++
    Win XP/2k/98

    I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!

    He's lean he's keen... He's the spank machine!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to poll sockets?
    By 39ster in forum Networking/Device Communication
    Replies: 3
    Last Post: 07-22-2008, 01:43 PM
  2. Cross platform sockets
    By zacs7 in forum Networking/Device Communication
    Replies: 5
    Last Post: 06-27-2007, 05:16 AM
  3. multiple UDP sockets with select()
    By nkhambal in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-17-2006, 07:36 PM
  4. Raw Sockets and SP2...
    By Devil Panther in forum Networking/Device Communication
    Replies: 11
    Last Post: 08-12-2005, 04:52 AM
  5. Starting window sockets
    By _Cl0wn_ in forum Windows Programming
    Replies: 2
    Last Post: 01-20-2003, 11:49 AM