Results 1 to 7 of 7

Thread: Need help with winsock

  1. #1
    Hu9o
    Guest

    Need help with winsock

    Hi,

    I have made a simple chat program. It only works over a lan, for now. It is client/server and it communicates by TCP/IP and a port number.

    Below is a little part of the source code. I want to show on the chat screen with who you are connected. Both for the client and for the server. This was easy for the client
    ConnectedTo = tcpClient.RemoteHost
    But now the problem, how let the server screen show with whom a connection is made??

    Private Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
    Dim strData As String
    ConnectedTo = tcpServer.XXXXXX??
    Can anyone help me with my problem??

    Thanks in advance.

    Hu9o

  2. #2
    Hu9o
    Guest
    There must be someone who can help me....

  3. #3
    Hu9o
    Guest

    Angry

    ****, it has been 3 day now and still no awnser.... Looks like I am stuck here for ethernity.

  4. #4
    Lively Member
    Join Date
    Oct 2001
    Posts
    66
    Keep watching, I will post the probblem to a freind. He has solved this exact problem. I'll try to get a rapid response.

    regards,
    Shunt on Mustafi's account

  5. #5
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    OK, download the attachment. This is the program my friend is using at present.

  6. #6
    Hu9o
    Guest

    Thumbs up

    I have downloaded the file. Unfortunately there is no time to look at it for me now, but there will be later on the day.

    Thanks not forgeting about me!

    Hu9o

  7. #7
    Hyperactive Member Eyes.Only's Avatar
    Join Date
    Oct 2001
    Location
    Minnesota
    Posts
    347
    On the server, when a client tries to connect to it, the Winsock1_ConnectionRequest event is triggered.

    MSDN - "For TCP server applications only. The event is activated when there is an incoming connection request. RemoteHostIP and RemotePort properties store the information about the client after the event is activated."

    So on the server side, it would be...

    ConnectedTo = tcpServer.RemoteHostIP

    hope this helps u out.

Posting Permissions

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



Click Here to Expand Forum to Full Width