| | |
Socket programming....
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
•
•
Join Date: Jun 2009
Posts: 8
Reputation:
Solved Threads: 0
I'm designing chat application these days.. I tried several samples which i found from the web..
I designed Server and Client..
When i run client in my machine, server get it nicely..
but when server in my machine and client in other machine, server doesn't detect client..
I tried 5+ samples from the web.. every sample work like that.
In here we have dynamic IP address. is that the reason for my problem?
Is server need static IP address?
Give me help please... I'm totally stuck in here...
I designed Server and Client..
When i run client in my machine, server get it nicely..
but when server in my machine and client in other machine, server doesn't detect client..
I tried 5+ samples from the web.. every sample work like that.
In here we have dynamic IP address. is that the reason for my problem?
Is server need static IP address?
Give me help please... I'm totally stuck in here...
•
•
Join Date: Jun 2009
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
Is your server behind a router? if so just set the portforwarding to the port the server is using and forward it to the machine on what the server is running.
And also make sure the Client is connecting to the right IP and port
I checked IP and port.. Both are same in the server and client.
Actually I'm selfstuding VB.net. Therefore, if u can give me code sample for it, it's vary valuble for me.
However thanks for Reply....
•
•
Join Date: Jun 2009
Posts: 225
Reputation:
Solved Threads: 39
source code is attached. this is a VERY basic server/client application
for adjusting:
in the client application just change it to your needs ...
in the server App:
hope it helps
for adjusting:
in the client application just change it to your needs ...
vb Syntax (Toggle Plain Text)
Private Sub BGW1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BGW1.DoWork Try myClient = New TcpClient("localhost", 5000) BGW1.ReportProgress(100) Catch ex As SocketException e.Result = "offline" End Try End Sub
in the server App:
vb Syntax (Toggle Plain Text)
Private Sub DoListen() Try Listener = New TcpListener(Dns.GetHostEntry("localhost").AddressList(0), 5000) Listener.Start() Do Dim connectedClients As New clientClass(Listener.AcceptTcpClient) AddHandler connectedClients.Disconnected, AddressOf connectedClients_Disconnected AddHandler connectedClients.LineReceived, AddressOf connectedClients_LineReceived Clients.Add(connectedClients.ID, connectedClients) Loop Until False Catch End Try End Sub
hope it helps
![]() |
Similar Threads
- Socket Programming... (C#)
- About socket programming in php (PHP)
- Socket Programming (C++)
- Eclipse SDK/Socket Programming help (Java)
- Socket Programming (ASP.NET)
- C++ socket programming (C++)
- Socket programming + porting Unix to Win32 (C)
Other Threads in the VB.NET Forum
- Previous Thread: SQL
- Next Thread: How to build the correct way of n-tier apps without service and remoting?
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access add application arithmetic array assignment basic box button buttons center check click code combo component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net exists file-dialog firewall folder ftp hardcopy image images isnumericfuntioncall math mobile module mssqlbackend mysql navigate networking opacity output peertopeervideostreaming picturebox1 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left savedialog serial sqldatbase storedprocedure string tcp temp text textbox timer toolbox trim txttoxmlconverter updown useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml





