Results 1 to 22 of 22

Thread: [02/03] help creating a messenger

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    33

    [02/03] help creating a messenger

    guys im new to .net network programming and i want to make this simple messenger that would allow multiple connections, now i've read and downloaded the tutorial on sockets and the 1client - 1 server chat system. what i want to do is to have the program open with windows and stay in the background only to pop up when ever I (server) send a message to a specific client or all clients. Do I have to make the client server as a windows service? how do i go about doing that?
    i plan on using this application at home, i have like 5 pc's at home on 3 floors, and i want to be able to send a message to my sister or someone using a client computer on my home LAN.

    Thanks much for reading and your patience...
    \
    m1k3

  2. #2
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Post Re: [02/03] help creating a messenger

    New to .NET and you want to do something as complex as that? I think you might be getting in over your head.

    Why don't you just MSN Messenger instead? It's free, and it does exactly what you want.

    If that's not good enough for you, then turn on the service called "Messenger" (not the same as MSN or Windows Messenger). The Messenger service will also do what you want.
    ~Peter


  3. #3
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    Laugh out loud. Dude...MrGTi is right why don't you just use MSN messenger? They have the new Beta called "Windows Live Messenger Beta". Just download that.....it's pretty easy to use. But I'll also so see what I can do.
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  4. #4
    New Member
    Join Date
    Jun 2006
    Posts
    9

    Re: [02/03] help creating a messenger

    Hi. I do this task by using the NET SEND command. It is not a chat program, but just a message sender program. The problem with it is.. its functions are limited. They can only recieve the message, but they cannot reply. But in most cases, this is not important, especially if you are an admin.

  5. #5
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    Re: [02/03] help creating a messenger

    g0d5_g1ft you may want to take alook at msdn's async socket examples.

    despite the bit of chatter you catch quickly when asking hard questions there are actually people here who can help... provided you actually have something you need help with.


    MSDN Async Server Socket Example
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

  6. #6
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    Ok first of all you need to have a server. Once you have a server then you can build the chat client. The server has to be listening and then you can start using the chat client. This may not be the best site but it pretty much sums up the things you need: http://www.eggheadcafe.com/articles/20020323.asp Sorry just noticed the guy above me, TokersBall_CDXX has the correct website you should use.
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  7. #7
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [02/03] help creating a messenger

    Ok first of all you need to have a server
    Just to clarify, any computer can be used as a server in the async socket examples. It's just a title they give to the computer everyone is connecting to.

  8. #8
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    Quote Originally Posted by sevenhalo
    Just to clarify, any computer can be used as a server in the async socket examples. It's just a title they give to the computer everyone is connecting to.
    Yea. Sorry. That's what I meant. You still need to host the server though!
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  9. #9
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [02/03] help creating a messenger

    Quote Originally Posted by sheikh78
    Yea. Sorry. That's what I meant. You still need to host the server though!
    Yep yep, so long as it's listening.

    I had worked on something like this awhile back. The full source is here (along with the issue I was having):
    http://www.vbforums.com/showthread.php?t=390441

    It's a modified version of that async socket example Tokers posted. It might be of some help?

    (It's crazy to think that project was only 3 months ago... It feels like ages and ages. It's true what they say; as programmers, we live entire lives in the span of a week.)

  10. #10

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    33

    Re: [02/03] help creating a messenger

    thanks guys, ok i may not be exactly new to .net... ive got the client -server messenger thing done... my only concern was for the client to start with windows, i got that too , the last thing was for the client to be hidden after it starts and just pop up whenever the admin(me) sends a message to the client... much like yahoo or msn, it stays in with the icons by the system clock... hows that? thanks for all the replies....

  11. #11
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    That's a notify icon. If you need more details look at this http://msdn2.microsoft.com/en-us/lib...otifyicon.aspx and this http://msdn2.microsoft.com/en-us/lib...n_members.aspx. Good Luck!
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  12. #12

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    33

    Re: [02/03] help creating a messenger

    thanx sheikh i'll look into this

  13. #13
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    Lol. This may be funny but I can't get the server to work. Does anybody have some sample code? I have this as my code from the MSDN article:

    VB Code:
    1. Imports System.Net.Sockets
    2. Imports System.Text
    3. Imports System
    4. Imports System.Net
    5. Imports System.Threading
    6. Class TCPSrv
    7.  
    8.     ' State object for reading client data asynchronously
    9.     Public Class StateObject
    10.         ' Client  socket.
    11.         Public workSocket As Socket = Nothing
    12.         ' Size of receive buffer.
    13.         Public Const BufferSize As Integer = 1024
    14.         ' Receive buffer.
    15.         Public buffer(BufferSize) As Byte
    16.         ' Received data string.
    17.         Public sb As New StringBuilder()
    18.     End Class 'StateObject
    19.  
    20. Public Class AsynchronousSocketListener
    21.  
    22.     ' Incoming data from the client.
    23.     Public Shared data As String = Nothing
    24.  
    25.     ' Thread signal.
    26.     Public Shared allDone As New ManualResetEvent(False)
    27.  
    28.  
    29.     Public Sub New()
    30.     End Sub 'New
    31.  
    32.  
    33.     Public Shared Sub StartListening()
    34.         ' Data buffer for incoming data.
    35.         Dim bytes() As Byte = New [Byte](1024) {}
    36.  
    37.         ' Establish the local endpoint for the socket.
    38.         ' The DNS name of the computer
    39.         ' running the listener is "host.contoso.com".
    40.             Dim ipHostInfo As IPHostEntry = Dns.GetHostEntry(Dns.GetHostName())
    41.         Dim ipAddress As IPAddress = ipHostInfo.AddressList(0)
    42.             Dim localEndPoint As New IPEndPoint(ipAddress, 8000)
    43.  
    44.         ' Intializes a TCP/IP socket.
    45.         Dim listener As New Socket(AddressFamily.InterNetwork, _
    46.             SocketType.Stream, ProtocolType.Tcp)
    47.  
    48.         ' Bind the socket to the local endpoint and listen for incoming
    49.         ' connections.
    50.         Try
    51.             listener.Bind(localEndPoint)
    52.                 listener.Listen(1)
    53.  
    54.             While True
    55.                 ' Set the event to nonsignaled state.
    56.                 allDone.Reset()
    57.  
    58.                 ' Start an asynchronous socket to listen for connections.
    59.                 Console.WriteLine("Waiting for a connection...")
    60.                     listener.BeginAccept(New AsyncCallback(AddressOf AcceptCallback), _
    61.                     listener)
    62.  
    63.                 ' Wait until a connection is made before continuing.
    64.                 allDone.WaitOne()
    65.             End While
    66.  
    67.         Catch e As Exception
    68.             Console.WriteLine(e.ToString())
    69.         End Try
    70.  
    71.         Console.WriteLine(ControlChars.Cr + "Press ENTER to continue...")
    72.         Console.Read()
    73.     End Sub 'StartListening
    74.  
    75.  
    76.     Public Shared Sub AcceptCallback(ByVal ar As IAsyncResult)
    77.         ' Signal the main thread to continue.
    78.         allDone.Set()
    79.  
    80.         ' Get the socket that handles the client request.
    81.         Dim listener As Socket = CType(ar.AsyncState, Socket)
    82.         Dim handler As Socket = listener.EndAccept(ar)
    83.  
    84.         ' Create the state object.
    85.         Dim state As New StateObject()
    86.         state.workSocket = handler
    87.         handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, _
    88.             New AsyncCallback(AddressOf ReadCallback), state)
    89.     End Sub 'AcceptCallback
    90.  
    91.  
    92.     Public Shared Sub ReadCallback(ByVal ar As IAsyncResult)
    93.         Dim content As [String] = [String].Empty
    94.  
    95.         ' Retrieve the state object and the handler socket
    96.         ' from the asynchronous state object.
    97.         Dim state As StateObject = CType(ar.AsyncState, StateObject)
    98.         Dim handler As Socket = state.workSocket
    99.  
    100.         ' Read data from client socket.
    101.         Dim bytesRead As Integer = handler.EndReceive(ar)
    102.  
    103.         If bytesRead > 0 Then
    104.             ' There might be more data, so store the data received so far.
    105.             state.sb.Append(Encoding.ASCII.GetString(state.buffer, 0, _
    106.                 bytesRead))
    107.  
    108.             ' Check for end-of-file tag. If it is not there, read
    109.             ' more data.
    110.             content = state.sb.ToString()
    111.             If content.IndexOf("<EOF>") > -1 Then
    112.                 ' All the data has been read from the
    113.                 ' client. Display it on the console.
    114.                 Console.WriteLine("Read {0} bytes from socket. " + _
    115.                     ControlChars.Cr + " Data : {1}", content.Length, content)
    116.                 ' Echo the data back to the client.
    117.                 Send(handler, content)
    118.             Else
    119.                 ' Not all data received. Get more.
    120.                 handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, _
    121.                     0, New AsyncCallback(AddressOf ReadCallback), state)
    122.             End If
    123.         End If
    124.     End Sub 'ReadCallback
    125.  
    126.  
    127.     Private Shared Sub Send(ByVal handler As Socket, ByVal data As [String])
    128.         ' Convert the string data to byte data using ASCII encoding.
    129.         Dim byteData As Byte() = Encoding.ASCII.GetBytes(Data)
    130.  
    131.         ' Begin sending the data to the remote device.
    132.         handler.BeginSend(byteData, 0, byteData.Length, 0, _
    133.             New AsyncCallback(AddressOf SendCallback), handler)
    134.     End Sub 'Send
    135.  
    136.  
    137.     Private Shared Sub SendCallback(ByVal ar As IAsyncResult)
    138.         Try
    139.             ' Retrieve the socket from the state object.
    140.             Dim handler As Socket = CType(ar.AsyncState, Socket)
    141.  
    142.             ' Complete sending the data to the remote device.
    143.             Dim bytesSent As Integer = handler.EndSend(ar)
    144.             Console.WriteLine("Sent {0} bytes to client.", bytesSent)
    145.  
    146.             handler.Shutdown(SocketShutdown.Both)
    147.             handler.Close()
    148.  
    149.         Catch e As Exception
    150.             Console.WriteLine(e.ToString())
    151.         End Try
    152.     End Sub 'SendCallback
    153.  
    154.     'Entry point that delegates to C-style main Private Function.
    155.         Private Overloads Shared Sub Main()
    156.             System.Environment.ExitCode = _
    157.             Main(System.Environment.GetCommandLineArgs())
    158.         End Sub
    159.  
    160.     Public Overloads Shared Function Main(ByVal args() As [String]) As Integer
    161.         StartListening()
    162.         Return 0
    163.     End Function 'Main
    164. End Class 'AsynchronousSocketListener
    165. End Class

    NEXT POST
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  14. #14
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    And this also from the MSDN article for the chat client:

    VB Code:
    1. Imports System
    2. Imports System.Net
    3. Imports System.Net.Sockets
    4. Imports System.Threading
    5. Imports System.Text
    6.  
    7. ' State object for receiving data from remote device.
    8. Public Class StateObject
    9.     ' Client socket.
    10.     Public workSocket As Socket = Nothing
    11.     ' Size of receive buffer.
    12.     Public BufferSize As Integer = 256
    13.     ' Receive buffer.
    14.     Public buffer(256) As Byte
    15.     ' Received data string.
    16.     Public sb As New StringBuilder()
    17. End Class 'StateObject
    18.  
    19. Public Class AsynchronousClient
    20.     ' The port number for the remote device.
    21.     Private Shared port As Integer = 8000
    22.  
    23.     ' ManualResetEvent instances signal completion.
    24.     Private Shared connectDone As New ManualResetEvent(False)
    25.     Private Shared sendDone As New ManualResetEvent(False)
    26.     Private Shared receiveDone As New ManualResetEvent(False)
    27.  
    28.     ' The response from the remote device.
    29.     Private Shared response As [String] = [String].Empty
    30.  
    31.  
    32.     Private Shared Sub StartClient()
    33.         ' Connect to a remote device.
    34.         Try
    35.             ' Establish the remote endpoint for the socket.
    36.             ' The name of the
    37.             ' remote device is "host.contoso.com".
    38.             Dim ipHostInfo As IPHostEntry = Dns.GetHostEntry("127.0.0.1")
    39.             Dim ipAddress As IPAddress = ipHostInfo.AddressList(0)
    40.             Dim remoteEP As New IPEndPoint(ipAddress, port)
    41.  
    42.             '  Create a TCP/IP socket.
    43.             Dim client As New Socket(AddressFamily.InterNetwork, _
    44.                 SocketType.Stream, ProtocolType.Tcp)
    45.  
    46.             ' Connect to the remote endpoint.
    47.             client.BeginConnect(remoteEP, AddressOf ConnectCallback, client)
    48.             connectDone.WaitOne()
    49.  
    50.             ' Send test data to the remote device.
    51.             Send(client, "This is a test<EOF>")
    52.             sendDone.WaitOne()
    53.  
    54.             ' Receive the response from the remote device.
    55.             Receive(client)
    56.             receiveDone.WaitOne()
    57.  
    58.             ' Write the response to the console.
    59.             Console.WriteLine("Response received : {0}", response)
    60.  
    61.             ' Release the socket.
    62.             client.Shutdown(SocketShutdown.Both)
    63.             client.Close()
    64.  
    65.         Catch e As Exception
    66.             Console.WriteLine(e.ToString())
    67.         End Try
    68.     End Sub 'StartClient
    69.  
    70.  
    71.     Private Shared Sub ConnectCallback(ByVal ar As IAsyncResult)
    72.         Try
    73.             ' Retrieve the socket from the state object.
    74.             Dim client As Socket = CType(ar.AsyncState, Socket)
    75.  
    76.             ' Complete the connection.
    77.             client.EndConnect(ar)
    78.  
    79.             Console.WriteLine("Socket connected to {0}", _
    80.                 client.RemoteEndPoint.ToString())
    81.  
    82.             ' Signal that the connection has been made.
    83.             connectDone.Set()
    84.         Catch e As Exception
    85.             Console.WriteLine(e.ToString())
    86.         End Try
    87.     End Sub 'ConnectCallback
    88.  
    89.  
    90.     Private Shared Sub Receive(ByVal client As Socket)
    91.         Try
    92.             ' Create the state object.
    93.             Dim state As New StateObject()
    94.             state.workSocket = client
    95.  
    96.             ' Begin receiving the data from the remote device.
    97.             client.BeginReceive(state.buffer, 0, state.BufferSize, 0, _
    98.                 AddressOf ReceiveCallback, state)
    99.         Catch e As Exception
    100.             Console.WriteLine(e.ToString())
    101.         End Try
    102.     End Sub 'Receive
    103.  
    104.  
    105.     Private Shared Sub ReceiveCallback(ByVal ar As IAsyncResult)
    106.         Try
    107.             ' Retrieve the state object and client socket
    108.             ' from the asynchronous state object.
    109.             Dim state As StateObject = CType(ar.AsyncState, StateObject)
    110.             Dim client As Socket = state.workSocket
    111.  
    112.             ' Read data from the remote device.
    113.             Dim bytesRead As Integer = client.EndReceive(ar)
    114.  
    115.             If bytesRead > 0 Then
    116.                 ' There might be more data, so store the data received so far.
    117.                 state.sb.Append(Encoding.ASCII.GetString(state.buffer, 0, _
    118.                     bytesRead))
    119.  
    120.                 ' Get the rest of the data.
    121.                 client.BeginReceive(state.buffer, 0, state.BufferSize, 0, _
    122.                     AddressOf ReceiveCallback, state)
    123.             Else
    124.                 ' All the data has arrived; put it in response.
    125.                 If state.sb.Length > 1 Then
    126.                     response = state.sb.ToString()
    127.                 End If
    128.                 ' Signal that all bytes have been received.
    129.                 receiveDone.Set()
    130.             End If
    131.         Catch e As Exception
    132.             Console.WriteLine(e.ToString())
    133.         End Try
    134.     End Sub 'ReceiveCallback
    135.  
    136.  
    137.     Private Shared Sub Send(ByVal client As Socket, ByVal data As [String])
    138.         ' Convert the string data to byte data using ASCII encoding.
    139.         Dim byteData As Byte() = Encoding.ASCII.GetBytes(data)
    140.  
    141.         ' Begin sending the data to the remote device.
    142.         client.BeginSend(byteData, 0, byteData.Length, 0, _
    143.             AddressOf SendCallback, client)
    144.     End Sub 'Send
    145.  
    146.  
    147.     Private Shared Sub SendCallback(ByVal ar As IAsyncResult)
    148.         Try
    149.             ' Retrieve the socket from the state object.
    150.             Dim client As Socket = CType(ar.AsyncState, Socket)
    151.  
    152.             ' Complete sending the data to the remote device.
    153.             Dim bytesSent As Integer = client.EndSend(ar)
    154.             Console.WriteLine("Sent {0} bytes to server.", bytesSent)
    155.  
    156.             ' Signal that all bytes have been sent.
    157.             sendDone.Set()
    158.         Catch e As Exception
    159.             Console.WriteLine(e.ToString())
    160.         End Try
    161.     End Sub 'SendCallback
    162.  
    163.     'Entry point that delegates to C-style main Private Function.
    164.     Private Overloads Shared Sub Main()
    165.         System.Environment.ExitCode = _
    166.            Main(System.Environment.GetCommandLineArgs())
    167.     End Sub
    168.  
    169.  
    170.     Public Overloads Shared Function Main(ByVal args() As [String]) As Integer
    171.         StartClient()
    172.         Return 0
    173.     End Function 'Main
    174. End Class 'AsynchronousClient

    Help? The client keep saying: "System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it." But if you look at the code it doesn't refuse it.
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  15. #15
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    I should also specify that I am using the .NET Framework 2.0, VB.NET 2005
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  16. #16
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    anybody?
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  17. #17
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    Re: [02/03] help creating a messenger

    in your server code...
    VB Code:
    1. Dim ipHostInfo As IPHostEntry = Dns.GetHostEntry(Dns.GetHostName())
    2. Dim ipAddress As IPAddress = ipHostInfo.AddressList(0)
    3. Dim localEndPoint As New IPEndPoint(ipAddress, 8000)

    basically gets the first interface address and makes an endpoint out of it.
    127.0.0.1 is not an interface, but rather localhost loopback found in your host file.

    try connecting to your system's real ip address... (the first interface when you run ipconfig)
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

  18. #18
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    In the server code are you saying that I should connect to my computer's ip address? like:

    VB Code:
    1. Dim ipHostInfo As IPHostEntry = Dns.GetHostEntry("xxx.xxx.xxx.xxx")
    2. Dim ipAddress As IPAddress = ipHostInfo.AddressList(0)
    3. Dim localEndPoint As New IPEndPoint(ipAddress, 8000)

    ? And for the client should I change any code in there? Because the client, once it starts automatically disappears....I think it is something with the code...I'll check out in the meantime.
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  19. #19
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    Anyway I got my code to work. But my server can't be accessed from computers outside my home. I tell their clients to connect to my ip address to access the server console....but it doesn't work for them, yet the same client works for me. Any ideas how to fix this?
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  20. #20
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    Help? Por favor? Civu Play? (ok so i don't know the exact spelling in french, its been a long time). LOOK AT ABOVE PLEASE IF YOU ARE COMING FROM MY OTHER THREAD!
    Last edited by sheikh78; Jun 14th, 2006 at 08:07 PM.
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

  21. #21
    Addicted Member
    Join Date
    Dec 2005
    Posts
    139

    Re: [02/03] help creating a messenger

    Quote Originally Posted by sheikh78
    Anyway I got my code to work. But my server can't be accessed from computers outside my home. I tell their clients to connect to my ip address to access the server console....but it doesn't work for them, yet the same client works for me. Any ideas how to fix this?
    Are you behind a firewall or router? If so you may need to open the ports your server is using or doing some port forwarding, I think.

  22. #22
    Hyperactive Member sheikh78's Avatar
    Join Date
    Apr 2006
    Location
    C:/
    Posts
    423

    Re: [02/03] help creating a messenger

    I opened up ports using code and I had turned off my firewall when this was happening.
    "Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
    Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!

    "Thinking of you, wherever you are
    We pray for our sorrows to end, and hope that our hearts will blend.
    Now I will step forward to realize this wish.
    And who knows, starting a new journey may not be so hard…
    Or maybe it has already begun.
    There are many worlds, but they share the same sky
    one sky, one destiny..."

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