Server Sockets : Showing Each Connect Ip?
Mar 25, 2011
im making a sort of basic server with ban and console broadcast and yea but now i thought to make evry user that's connected (tho the running server)(their ip) in to a listview with their username (that will be defined in to a textbox on the client) any idea's how to do it ? if you want here is my sevrer code :
Form1.vb (Main form for starting stoping broadcasting and such )
Imports System.Text
Imports System.Threading.Thread
Imports System.Net
[code]....
EDIT : does this server support's mulltiple connection's ?
View 4 Replies
ADVERTISEMENT
Aug 2, 2010
i made a program that uses sockets to connect the server to client but there is a problem with it when i try it on this ip"127.0.0.1"wich is not a real ip just a loopback to my computer it works just fine when i use my local ip it works as well when i use my main ip from http:whatsmyip.org it doesnt work at all i dont know why it doesnt say an error or an exception but its not connecting so i gave the server to a friend of mine i tried using both his real ip and his local but still not working i dont know why?i mean i am 100% sure of my code...
View 7 Replies
Jan 16, 2011
I am new to vb.net (2010) and am working on a project that has to send information from a client application form to a php-based web page.
View 1 Replies
Oct 26, 2009
I have some really nice Python code to do what I need to do.I don't particularly like any of the Python GUI choices though. wxPython is nice, but for what I need, the speed on resizing,refreshing and dynamically adding controls just isn't there. I would like to create the GUI in VB.NET.I imagine I could use IronPython to link the two,but that creates a dependency on a rather large third-party product. I was perusing the MSDN documentation on Windows IPC and got the idea to use sockets. I copied the Python echo server code from the Python documentation and in under 5 minutes was able to create a client in VB.NET without even reading the System.Net.Sockets documentation, so this certainly doesn't seem too hard.
View 2 Replies
Jul 25, 2011
I'm using vb .net 2008 with 3.5 framework. (the following 2 classes are put in a DLL that i import in a main application)
Server class:
Code:
Imports System.Xml
Imports System.Net.Sockets
Imports System.Text
Imports System.Net
[code]....
Basically in my main application i am instantiating the client class from this dll, as well as the server one. On the client form i got a "send data" (SendFISA sub) and a "connect" button. After connecting the client and clicking on the "send data" i am sending to the server a string formed of some information created when instantiating the client class from the dll (i can't make that type of data public, but i'm just using a constructor to assign values to a class object, nothing special).
Now, when the server receives the data sent by "send data" button click it responds with "PKG_SENT" corresponding to the "FISASENT" string terminator(in the module) of the string that was sent. The "WRONG_MSG" constant is for when the string terminator is different from the 2 from above.
On the local disk, if the server cannot be reached, the client saves an xml file with this data. In the dll i made a timer that ticks every 5 seconds and checks to see if there is any xml file on the disk and sends it to the server if the connection is ok (trimiteXML sub). The server would respond with "XML_SENT" corresponding to the string terminator "XMLSENT"(in the module) appended to the read string from the xml file. After the file is sent it is deleted from the local dir.
The problem occurs when i click "send data" AND there are XML files to be sent from the disk. I believe they are interpreted by the server somehow at the same time because the message is neither "PKG_SENT" nor "XML_SENT", but it becomes a combination of the "WRONG_MSG_TYPE" and "XML_SENT", "XML_SENTG_TYPE". I have no idea why this is happening and i basically want the socket to wait with sending the files from the disks until the "send data" finishes.
View 9 Replies
Jul 31, 2011
i have this code from msdn and added some of mine..
Public Shared Sub DoAcceptTcpClientCallback(ByVal ar As IAsyncResult)
' Get the listener that handles the client request.
Dim listener As TcpListener = CType(ar.AsyncState, TcpListener)
' End the operation and display the received data on
' the console.
Dim client As TcpClient = listener.EndAcceptTcpClient(ar)
' Process the connection here. (Add the client to a
' server table, read data, etc.)
Dim networkStream As NetworkStream = client.GetStream()
Dim bytes(client.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(client.ReceiveBufferSize))
Dim clientData As String = Encoding.ASCII.GetString(bytes)
MsgBox(clientData)
' Signal the calling thread to continue.
tcpClientConnected.Set()
End Sub 'DoAcceptTcpClientCallback
now the question is how can i put the clientdata from a listview?
i tried to put the listview control in this shared sub but i always got an error..
Quotecannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit initializer of the class
please enlighten me on this one..
View 1 Replies
Aug 18, 2011
TCP Server/Client - Disconnecting Sockets
View 3 Replies
Sep 22, 2009
i have lots of confused ideas like should you transfer files using tcp? Example: I was thinking, I connect to server from client, open file in binary, division by packet size(bytes), send first packet to server, get request if file was delivered succesfully, send next packet. If I do it this way i would need something to know/increase packet size.
View 5 Replies
Jun 29, 2009
I am trying to use the my.computer.network.ping method to check a server's ping. what I realize is that I need to open a socket. I do not know how to do that. I have a textbox with the website url.I have a label that will display ping.
View 2 Replies
Aug 10, 2011
I am building a client-server type applications and they are communicating over sockets. This is the first time I am doing such a program and I have been learning off a web example and thought I understood it all but it would appear I am missing something as it starts to work then errors. Here is what I have:
VB
Dim serverSocket As New TcpListener(ListeningPort)
Dim clientSocket As TcpClient
Dim netStream As NetworkStream
Dim BytesFrom(1024) As Byte
Dim DataFromClient As String
[Code] .....
All of the above works and if I open up a telnet command window I can connect to my machine running this code on my specified port and in the command prompt window 'IDENTIFY' appears as it should from the above code. But it then gets to this block an errors on the second line:
VB
'RECEIVE FROM CLIENT
netStream = clientSocket.GetStream()
netStream.Read(BytesFrom, 0, CInt(clientSocket.ReceiveBufferSize))
DataFromClient = System.Text.Encoding.ASCII.GetString(BytesFrom)
Now as far as I can tell it shouldn't be processing the first line
[ netStream = clientSocket.GetStream() ]
Until I send something back from the client because then going on to the second line its trying to process something that isn't there yet.
The actual error I get is:
Specified argument was out of the range of valid values. Parameter name: size
On the line:
netStream.Read(BytesFrom, 0, CInt(clientSocket.ReceiveBufferSize))
View 8 Replies
Jun 21, 2010
I'm developing chat program. I have database on my webhosting where I store rooms and memebrship tables... I created the client, but I still cant do the server side of the program. It must be in win forms app.(I use .Net 3.5)Every tutorialSample of server side is for Console app. Client code is very close to this(if somebody need it): LINK
View 1 Replies
Jan 29, 2010
We have a small service shows continuous nonpaged pool bytes increase from the moment it is started. This is only on a 2008 server (all the others work fine).
The service basically connects a socket to a client to see if it's successful and then closes (most code omitted):
[Code]...
View 3 Replies
Dec 18, 2009
I have been developing an async socket connection server and client program. I have been testing it, and noticed that if I connect to the server from my client and then disconnect. Upon reconnecting I am on a different port(local IP still). This is fine, however when I go to send a message, and the server trys to update all the clients, it eventually hits clients that do not exist anymore. I get the SocketException 10054, and upon connecting/disconnecting enough, it no longer works at all. My question is how do I clear out these no longer useful sockets from the server? I am doing currentsocket.Shutdown(SocketShutDown.Both); and then a currentsocket.Close(); after that. When a user disconnects.
[Code]...
View 1 Replies
Sep 30, 2009
I'm trying to get a VB2008 multi thread application working that connects to a local server program using sockets. Server requests for this particular system can be more quickly handled by a number of connections, so I've written some code to run any number of data request threads that I choose. The problem that I'm having is that the data returned from the server is getting mixed up and is often returned to a different thread/socket than the one that requested it. Other than that, it seems to work okay. If I use just one thread, then the system works as it should. Pls. see incuded code, which is heavily edited to remove all the other fruit salad. Is there any way to set up the sockets so that data returned to the socket/thread that requested it?
Module StaticDeclarations
Public WithEvents g_SD As New SocketDataClass(New MainThread.MTCallback(AddressOf MainThread.MTResultCallbackSub))
Public WithEvents g_MT As New MainThread(New SocketDataClass.SDCallback(AddressOf SocketDataClass.SDThreadResultCallbackSub))
[code]....
View 4 Replies
Feb 10, 2010
I planing to develop an application which can connect any remote server and pick the configuration information from server and show it in my desktop.
View 4 Replies
Dec 7, 2010
How can I write a connection string? I has four different computer that can be connect via ethernet.How can I maintain a inserting data if to computer insert on same table at a single time..??
View 1 Replies
Jun 5, 2011
when connecting to sql server i get getting this error . please help how to resolve this problem
[Code]..
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
[Code]..
View 2 Replies
Apr 9, 2012
I have a small problem with sockets (I'm new to sockets). Below is the code I'm using. The problem is that when the client closes, the server closes aswell. How do I stop it from doing that?
[Code]...
View 1 Replies
Feb 18, 2011
I am trying to make a copy of an existing database, I use .net framework data provider for SQL Server.I get error "Unable to connect to source server for Transfer" when it runs to oPackage.Execute().
oConnection = oPackage.Connections.New("what the providerID should be?")
oStep = oPackage.Steps.New
oTask = oPackage.Tasks.New("DTSTransferObjectsTask")[code]......
View 1 Replies
Dec 6, 2009
Have you ever use it I want to ask this question used it and i connect a specified server. Now i create other server and name it to :[URL]..
How can i remove old server on VS and connect to new server.
View 6 Replies
Nov 10, 2011
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
[code]...
View 5 Replies
Dec 15, 2011
I want to create a openfiledialog and allow user to choose which exel file to be imported into the server but this error keep coming "ODBC--connection to '{SQL Server}'TGT102 failed".
[Code]...
View 3 Replies
Jun 9, 2011
When I run this code from vb.net Emulator it works fine but when I run the same code from a Win Mobile 5 PDA, it doesnt work pc and pda both in same network via a wireless router and i can ping each other.
here is my connection string -
ServerName = "192.168.0.100SQLSAMI"
ConStr = "server=" & ServerName & ";integrated security=FALSE;database=NanoFood;User Id=sa;Password=nanosoft"
Here is the error-
System.Data.SqlClient.SqlException was unhandled
Class=20
LineNumber=0
[code]....
View 1 Replies
Jan 28, 2009
I am trying to connect to SQL Server and I am getting the following error, yet when I check the surface configuration screen, it's accepting remote connections.
View 3 Replies
May 20, 2010
I want to make an application that runs on 3 client pc's. The application has to query his data from an SQL Server-database, which is running on my Small Business Server. After some google-searching, i think my server is ready, but I don't know how I can connect my vb.net application on my client pc, to my SQL Server on my server. Here is a screenshot of my Object Explorer from SQL Server:
I don't have any idea how I have to build up my connectionstring. The name of my server is SBS2008, and it is on the same network as my client pc.
View 15 Replies
Jun 28, 2010
I finished a win app which user can input data off line. User can use vpn to connect server to upload data. Now, boss want me to add a feature to auto connect to server using vpn once user start the app.
View 1 Replies
May 13, 2010
In my offline windows program, user have to do two steps to download files:
1)clicking a shortcut of vpn to connect to a server,
2)clicking a button to download files (done for this step)
How to code to connect to a server via vpn without clicking the shortcut? That is once user clicks the button will connect to the server via vpn and then download files.
View 1 Replies
Apr 23, 2009
I'm looking to connect to an existing ftp server, upload a file, wait while the server generates a report on it, and download that report back to the local machine in a vb.net 2.0 winforms project.Is there an existing FTP library that would be helpful to me for this? My task seems simple enough that I'd rather not get into the world of active vs. passive, sockets, etc.
View 4 Replies
Oct 24, 2009
I am a beginner in vb.net. I have installed Visual studio 2005 along with Sql Server coming in the same DVD. I can't connect to Sql server from vb.net as local host. Can you give basic connection procedures to connect with Sql server.
View 3 Replies
Jun 21, 2010
how connect to SQL server in vb.net using c#..
View 1 Replies