Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Help Winsock (client-server) Application


helo there ,im new to vb , and as im a working experience student the company whom i working with has given me project that is consider a small system/program that uses client - server concept.that means a server and 2 or more client which files and data are updated or modified using database at server from client(all the work are done in the client pc),i have this tutorial about winsock basic server - client application but couldn't understand. could anyone help me with my project ,i have done the interfaces ,buttons, menus, login using db,but just couldnt understand how ,when client insert data and it update it to the server.and how to do modules ,for it if any ,some tutorials or sample project would help me alot thank you.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
?'s About Winsock Client/server Application *Not Resolved*
ok this is the first time that i have ever used winsock in any application that i've written so any help would be greatly appreciated. here is my question:

1) i have a server app that all the clients will connect to for database operations and logons, (the server app is also going to be automated to do DB operations, not that anyone needed to know, but hey whatever), this has a winsock control.

2) now for the clients. when the app loads a login form pops up for the user to login. there is a winsock control on this form. when the form load it attempts to connect to the server. if connected when the user clicks the login it will send the user name and password to the server and the server will send back authentication to allow logging in.

3) here is were my many problem is. upon authentication the login form unloads and the mdi form is loaded which has a winsock control on it as well. HERE IS MY MAIN QUESTION: is there a way to lets say set the mdi form winsock control to the login winsock control or still have the mdi form winsock control know that it is still connected to the server so that i don't have to make it connect again.

here is my theory please let me know if it would work.



VB Code:
set mdiSocket = logSocket



Please any help or suggestions would be great

Remote Shutdown And Reboot Using Winsock With Client/server Application
Hello,

Is it possible to shutdown or reboot a remote computer on my lan using my current clinet/server app.

Any help wud be great, Thanks

Chris

Telnet Server, RF Client Bar Code Reader, Working With A VB Application Thin Client Application
> Hello To All,
>
> I need a little advice and direction.
>
> I trying to build and application where a RF (Radio Frequency 900mhz
> hand held Bar Code Reader) device would connect and enter and retrieve
> information from a VB application.
>
> Example of Screen:
> Updating Inventory:
>
> Invoice Number:_____________
>
> Part Number: _____________
>
> Quantity: _____________
>
> Press F2 to Save and Continue.
>
> How Do you build a Telnet or VT100 or VT220 Server application in VB
> that can create the Example and except the individual entries.
>
>
> The hand held device can connect to a server in Telnet (ANSI), but I
> just lost and can find anything solid on the web.
>
>
> Steven

Winsock, I Made A Server-Client... Now I'm Trying To Make A Server-Client+++
Trying to get this Winsock Chat thing to support more than 1 person. I don't know at ALL what to do... Could anyone push me in the right direction?

Also, I need help getting screen names to work as well. Thanks.

As you will see, I attempted to add multiple connections myself... I failed. =[

I'm using VB6.

Code:Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_LINESCROLL = &HB6
Dim ClientNum As Integer
Private Sub cmdSend_Click()
    Dim strdata As String
    strdata = "Server : " & txtmsg.Text
    tcpServer(0).SendData strdata
    Text1.Text = Text1.Text & strdata & vbCrLf
    txtmsg.Text = ""
    SendMessage Text1.hwnd, EM_LINESCROLL, 0, 10
End Sub

Private Sub Form_Load()
    Dim s As String
    s = InputBox("Server Port Number: ")
    tcpServer(0).Close
    tcpServer(0).LocalPort = s
    tcpServer(0).Listen
End Sub

Private Sub Form_Activate()
    txtmsg.SetFocus
End Sub

Private Sub tcpServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)

    If Not tcpServer(0).State = sckConnected Then
        ClientNum = ClientNum + 1
        tcpServer(ClientNum).Close
        Load tcpServer(ClientNum)
        tcpServer(ClientNum).Accept requestID
        Text1.Text = "User has entered the server..." & vbCrLf
        SendMessage Text1.hwnd, EM_LINESCROLL, 0, 10
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    MsgBox "Wanna-Be AIM"
    tcpServer(0).Close
End Sub
Private Sub tcpServer_DataArrival(Index As Integer, ByVal bytesTotal As Long)
    Dim strdata As String

    tcpServer(0).GetData strdata
    Text1.Text = Text1.Text & strdata & vbCrLf
    SendMessage Text1.hwnd, EM_LINESCROLL, 0, 10
End Sub

Winsock Query - Server To Client Messages Having Already Received Messages From Client
Hi,

I posted this onto VB Newbies but maybe it's a more intermediate query.

I have set up a client and server app so that many instances of client can connect to the server and send messages at the same time using Index=0 on the Winsock control on the Server.
However,

I want to send messages from server to client also - how can i do this since I get error message "Invalid operation in current state" when I try to connect from server to client - i need to get Winsock(0).State = connected and can't - do i need to name Winsock differently between 2 applications. I looked at www.winsockvb.com but can't find an answer to my problem.
My code on clicking command button on Server app is :

  Winsock(0).Close
  Winsock(0).RemoteHost = gstrIPAddress
  Winsock(0).RemotePort = Val(gstrPort)
  Winsock(0).Connect        'Seems like the connect isn't happening here - passes through it...

 gstrMessage = "Message to send"
If Winsock(0).State = sckConnected Then
    Winsock(0).SendData gstrMessage
    DoEvents
End If

Any guidance would be greatly appreciated!! Thanks!

Vb Winsock , Client Server Help
I have a client server app that i made and it is working fine, the users can chat and send privatemessages but i have a problem with the user list, When a user connects it adds their username to a list box on the server. The server then loops through the connections and loops through all the index's on the listbox and sends all the data to the clients. It works if there is 1 or two people connected when the third person connects it does this:
user,1
user,2
user,20

Now this is the way that i am sending data from the server to the client:

ElseIf splt(0) = 0 Then
List1.AddItem splt(1)
List2.AddItem splt(1) & "," & connect_num

For i = 1 To connect_num
For listn = 0 To List2.ListCount - 1
Winsock1(i).SendData "0," & List2.List(listn)
DoEvents
Next listn
Next i
Exit Sub

Note that the "0," is the way that i parse data, so that when the clent recieves that it knows that it is adding splt(1) to the listbox.

This is the way that the clent recieves the data:

ElseIf splt(0) = 0 Then
List1.AddItem splt(1) & "," & splt(2)
DoEvents
Exit Sub
Please any help would be awesome!

Winsock Server/client In One?
Hi,
I got a winsock that connects to a remoteip + port, and my problem is when the reply is comming back since the server is sending the reply back to the same port that it got the data from.

eg.
1. Winsock1 sends the data "hello" to SERVER
2. SERVER sends the reply back to the port that winsock1 is using.
How can i capture the reply? Can one winsock act as both client and server at the same time?
thanks,
naitsabes

Winsock Server Client
I want to do a program that people can use to chat. I want to send them the client and i will have the server. I want to use winsock to do this... can anyone help?

Winsock And Client Server.
in a client-server situation using winsock, is there a simple way of clients serching a range of IP's to check if a port is open (running the server) if so, add it to a list ..

for eg. a game uses port 10 to send small packets to client, so the client must search a range of IPs with port 10 open, to get a list of IP's within the range that has the game loaded.

Winsock Server And Client HELP!
Ok, I am building a server that can support multiple connections over a network, I can get one to connect, but not 2. Here's the Client code:


Code:
Dim PortNum As Integer
Dim UserName As String
Private Sub Command3_Click()

End Sub

Private Sub cmdConnect_Click()
Winsock2.Close
UserName = Text4.Text
Winsock2.RemoteHost = Text1.Text
Winsock2.RemotePort = 1640
Winsock2.Connect Text1.Text, 1640
If Winsock2.State = sckConnected Then MsgBox ("Connected to: " & Winsock2.RemoteHostIP)
Text4.Enabled = False
End Sub

Private Sub cmdExit_Click()
Winsock1.Close
Winsock2.Close
End
End Sub

Private Sub cmdHelp_Click()
MsgBox ("LOCAL IP: " & Winsock1.LocalIP & vbCrLf & "LOCAL HOSTNAME: " & Winsock1.LocalHostName & vbCrLf & "LOCAL PORT: " & Winsock1.LocalPort)
End Sub

Private Sub cmdSend_Click()
Winsock2.SendData UserName & ": " & Text3.Text
Text2.Text = Text2.Text & vbCrLf & "You: " & Text3.Text
Text3.Text = ""
End Sub

Private Sub Form_Load()
PortNum = InputBox("What port number do you want to use?")
Winsock1.Close
Winsock2.Close
Winsock1.LocalPort = 1650
Winsock1.Listen
End Sub

Private Sub Form_Terminate()
Winsock1.Close
Winsock2.Close
End
End Sub

Private Sub Form_Unload(Cancel As Integer)
Winsock1.Close
Winsock2.Close
End
End Sub

Private Sub Winsock1_Connect()
MsgBox ("Connected to: " & Winsock1.RemoteHostIP)
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim tempdata As String
Winsock1.GetData tempdata, vbString
If tempdata = "//kill " & Winsock1.LocalIP Then Unload Form1
If Left(tempdata, 6) <> "//kill" Then Text2.Text = Text2.Text & vbCrLf & tempdata
End Sub

Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox "There was an error on the receiving side"
Winsock1.Close
Winsock2.Close
Unload Form1
End Sub

Private Sub Winsock2_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox "There was an error on the sending side"
Winsock1.Close
Winsock2.Close
Unload Form1
End Sub


(Using port 1640)

here's the server code:

Code:
Dim i As Integer

Private Sub Command1_Click()
Text1.Text = Text1.Text & vbCrLf & "Connected: " & i
For j = 1 To i
Winsock4(j).SendData Text2.Text
Text1.Text = Text1.Text & vbCrLf & "Server: " & Text2.Text
Text2.Text = ""
Next j
End Sub

Private Sub Command2_Click()
Close All
Unload Form1
End Sub

Private Sub Form_Load()
i = 0
Winsock1.Close
Winsock3.Close
Winsock4(0).Close
Winsock2(0).Close
Winsock1.LocalPort = 1640
Winsock1.Listen
End Sub

Private Sub Form_Unload(Cancel As Integer)
Winsock1.Close
Winsock3.Close
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
i = i + 1
Load Winsock2(i)
Load Winsock4(i)
Winsock2(i).Close
Winsock4(i).Close
Winsock2(i).Accept requestID
Winsock4(i).Connect Winsock1.RemoteHostIP, 1650
Text1.Text = Text1.Text & vbCrLf & "Winsock2: " & i & " requesting connection..." & "(ID: " & requestID & ")"
Text1.Text = Text1.Text & vbCrLf & "Winsock4: " & i & " connecting to: " & Winsock4(i).RemoteHostIP
Winsock1.Close
Winsock1.LocalPort = 1640
Winsock1.Listen
End Sub

Private Sub Winsock2_Close(Index As Integer)
Winsock2(Index).Close
Text1.Text = Text1.Text & vbCrLf & "Winsock2: " & Index & " is closing..."
End Sub

Private Sub Winsock2_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim TempData As String
Winsock2(Index).GetData TempData, vbString
Text1.Text = Text1.Text & vbCrLf & "Winsock: " & Index & " IP: " & Winsock2(Index).RemoteHostIP & ": " & TempData
End Sub


ANY help is appreciated...

Winsock Client/Server Woes...
I am writing (already wrote) an application that attempts to connect two or more computers together using Winsock in the Server/Client mode. I wrote to seperate applications one that acts as the Server and the other that acts as the Client. I tested the application out on my own computer (as I only have one pc) and the Client app is able to connect to the Server and send data back and forth. At first I used the 127.0.0.1 IP address, then later changed that to my actual IP address, both worked when running both the Server and Client app on my own PC. Ok, on to the big test. I gave my Client app to someone to run on their home computer and made sure my Server app was up and running. They couldn't connect to my computer. Any idea on what could be going on? Any way to do some kind of ping test in VB between computers? Suggestions?

vr

Xeifrank

Winsock Server Client Problem
when the client tries to connect to the server it gives this error:
Run-time '10049'

Address is not available from from the local machine



the code for the client is(note txtip is set by another function which works correctly):
Option Explicit

Private Sub Form_Load()
' set up the winsock to connect to the local computer
Winsock1.RemoteHost = txtip.Text
Winsock1.RemotePort = 10101
Winsock1.Connect
End Sub

Private Sub cmdSend_Click()
' send the data thats in the text box and
' clear it to prepare for the next chat message
Winsock1.SendData txtChat.Text
DoEvents
txtMain.Text = txtMain.Text & vbCrLf & txtChat.Text
txtChat.Text = ""
End Sub

Private Sub Winsock_Connect()
' we are connected!
MsgBox "Connected"
End Sub

Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
' get the data from the socket
Winsock1.GetData strData
' display it in the textbox
txtMain.Text = txtMain.Text & vbCrLf & strData
' scroll the box down
txtMain.SelStart = Len(txtMain.Text)
End Sub

Private Sub Winsock_Error(ByVal Number As Integer, Description As String, _
ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, _
ByVal HelpContext As Long, CancelDisplay As Boolean)
' an error has occured somewhere, so let the user know
MsgBox "Error: " & Description
' close the socket, ready to go again
End Sub

Client-Server Connections With WinSock
Hello,

I'm writing a game in which periodic updates will be required, to the point where an updater tool would be much more efficient than forcing a user to go to a site and download it themselves. Therefore, I decided that I'd code it myself, using WinSock (for greater control, and also because I'm fairly familiar to it).

So far the coding itself is coming along fine, but I wonder sometimes if I'm going about this the right way. Currently, I have an ActiveX DLL that I wrote containing the client and server class module, in hopes of me being able to update it in the future. However, I have come across some unforeseen problems:

1) There is an invisible Form in the DLL. This is where I put my WinSock controls, as it was much faster than learning all the API commands to make it work. The WinSocks are each handled by a different instance of the server class, which in hindsight seems a mistake -- to make that idea work requires a module, and it seems that I cannot call the routines in the module from the main app! To solve this, I put a third class module in that simply calls all of the subs from the module whose routines are hidden. This works fine; however, it effectively requires me to write any sub twice -- which takes much longer than it would seem.

2) For the life of me, I can't get my server to connect to my client! The problem, I think, is that 'address is in use' -- I'll be able to solve this myself, but what a nightmare ...

3) Writing a little "status" into both the server and client class is very trying. Getting them to tell each other what they are doing without interrupting some other operation is very straightforward, but not easy. Currently, I have special "flags" appended to the front of the data being sent, telling the opposite class their status instructions. This seems to be inefficient or crude, but seems to work. Are there any other better ways?

Sorry for the long-winded post, but I needed describe everything in sufficent detail to be understood

Thanks,
Amrazek

Client/Server Program Using TCP/IP With Winsock....
I have a question if I want to send a multiple text boxes from client program to the server program, how can I do that?

For example, I have 5 text boxes in a client program named, txtIP, txtPort, txtFirstName, txtLastName, and txtTitle. I want to send all of them to the server program and let the server program show the same text boxes in txtIP, txtPort, txtFirstName, txtLastName, and txtTitle.

I have found some client/server program that send message from one text box to another text box like chat program, but not different text boxes.

Thank you for your time.

Winsock, TCP, Client/server Limitations?
Hi all -- hope someone can give me some insight here. I'm writing in VB6, using a winsock server to communicate with multiple winsock thin clients, meaning that I receive database queries from the clients, have the server app perform the queries, and return the requested data to the clients for display, etc. I am using an Access 2000 database for my back end.

My question is, where does this break down? I create an array of Winsock controls to handle the multiple client apps, but I am concerned that, at some point, and maybe sooner than later, this architecture will crash under stress. Can anyone give me any insight to applications you may have built like this one, or any advice?

thanks!

Two Winsock Controls On Server, One On Client.
I am trying to figure out how this works.
Two winsock controls on the server, one for accepting connects and one for everything else.

This is for a chat lobby by the way.
I am having a problem though.

This isnt my code and its fairly complicated to me.

For some reason tho the "state" of the client's socket is "1" and not "7" when the
sckMain_Connect()
is called.

I am not an expert in this but I was messing around and with this other chat I was messing around with, it returned 7 as the state, which is connected. 1 is open.

What would cause this to happen?

When my friend used this code in the past he had no problem. There really hasent been any changes. What could be the problem? By the way, When I close the server, the client gets its "disconnected" message immedieatly as the server is closed so there is some sort of connectivity going on because the client knows when the socket is disconnected.

Winsock Client To Server Problem.
Here is the Client source.


Code:
Private Sub Form_Load()
Me.Hide
Winsock1.RemoteHost = "199.128.2.1"
Winsock1.RemotePort = 25
Winsock1.Connect
End Sub

Private Sub Timer1_Timer()
Text1.Text = "Ask me a question"
End Sub


Private Sub Winsock1_Click()

End Sub

Private Sub Timer2_Timer()
Winsock1.SendData Text1.Text
End Sub
Here is the Server code.


Code:
Private Sub Form_Load()
Me.Hide
Winsock.LocalPort = 25
Winsock.Listen
End Sub

Private Sub Winsock_ConnectionRequest(ByVal requestID As Long)
Winsock.Close
Winsock.Accept requestID
End Sub

Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
' get the data and display it in the textbox
Winsock.GetData strData
Text1.Text = strData
Open App.Path & "/text.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub
So basically the user downloads the client and opens it then when it loads it makes a connection to me, and sends me the text1.text property every 10 seconds.

The server is just listening for the info, and when it gets it writes it into a .txt file.

FOr some reason this works flawless on my network but when people outside of my network try it they get an error titled

"Run-Time error '40006' - Wrong protocol or connection state for requested transaction or request"

Both of the winsock controls on the client and server are sent to
TCP.

Client, Server Winsock Problem
I have a client server app that i made but there is a problem, when the user connects it takes the connect_num and adds 1 to it and that is their load winsock1(connect_num). But when you have say 3 users and user 2 disconnects the connect_num goes to 2 because thats all the users connected. But the connect_num's for the users are 1 and 3. My question is how can i fix this problem what i was going to do is when a user connects check and see if the winsock1(connect_num) is in use and if it is then check the next one and if its not in use then load it. But i dont know how to check and see if winsock1(connect_num) is in use.

Thanks for the help
Murph

Need Help With My Server Client (A WinSock Question)
I am using WinSock to program a server client for a chat messenger that I am developing and I have a question.

How do I make it so that when a person connects, it displays thier hostname in a list box, and when you click "Remove Name" it will disconnect that user from the server?

How To Client Server Without Winsock Control?
I know that if wanted to build a client server chatting application needs a winsock control on to the form.

however, this will require the user to have the .ocx installed onto thier computer as well.

So, i was thinking. is there any API that does the same winsock job without any extra installation of the .ocx or .dll?

i just want to make a standalone .exe only. hate to have those extra junks following around my .exe wherever i go.

Winsock Client Leaves Server
how do i know when the client leaves the connection?

i have this code to close winsock if it isn't needed anymore, but i also log how many ppl are on server and their ips and i want to remove them from the list when they leave. How do i know when they leave?


VB Code:
If Winsock1(Index).State <> sckClosed Then        Winsock1(Index).Close        End If

Server/client Chat W/ Winsock.. Help Me Please :)
hello... i'm attempting to make a chat with a server... and clients... however, i can't seem to be getting anything to work... im not sure if its the way im reading data from one to the other or what... so far they connect... that's about it... heh... i've got my source code here.... LOTS of comments in it!!! heh and its pretty clean so far i think....

would someone be a real nice person and try it for me and see if they can't get the basic functions i have on there right now to work? right now i just am trying to get messages to work, user entering lobby to work and user fetching list of users in lobby...

i've uploaded the source... its not too big as it is featureless right now ...

thank you soooo much in advance for the help... i know there are a few winsock wizards around here.

Winsock - Client/Server Programming
I've decided to write my own Client/Server application for practice. Even though it's only for practive, I still want it at it's best. Here are some troubles I've had:
1) Difficult as hell time for client to know if he's been disconnected by server.
2) I was messing around with a port scanner which would ID the server running if it found one. How do I give my server an ID?
3) The Client nor the Server can detect anything(if data was sent; using DataArrival)

Right now, these are my main concerns, if you have any Documents about using Winsock, please tell me. I'm not really that interested in example code(alot of it is hard to understand).

thanks

Winsock - Client/Server Programming
I've decided to write my own Client/Server application for practice. Even though it's only for practive, I still want it at it's best. Here are some troubles I've had:
1) Difficult as hell time for client to know if he's been disconnected by server.
2) I was messing around with a port scanner which would ID the server running if it found one. How do I give my server an ID?
3) The Client nor the Server can detect anything(if data was sent; using DataArrival)

Right now, these are my main concerns, if you have any Documents about using Winsock, please tell me. I'm not really that interested in example code(alot of it is hard to understand).

thanks

Winsock Client Server STATUS
I am Developing and Winsock Client and Server

When I conenct from the Client with
MySock.connect 192.162.10.1,5000 this connects to the Server and the STATUS at Both End becomes '7=Connected '.

BUT When I SENDDATA fm the Client to Server the STATUS of the SERVER Becomes 2 = Listen
and it is not getting changed.

After that the Server Stops sending the DATA because of the STATUS.

CAn U help me please......

Server Client Application
Hello All,
I'm seriously in need on info on how to write an App that runs on a LAN and specifically can monitor the client from the server. For instance, the server can view if any of its clients aer running that program and what state it is.

A Web Cafe Client program is an example of what i'm thinking about

Can anyone help me please?

Client Server Application
i put my sql server database on windows 2003 server.how can i connect my application on other pc(client) and get data from my sql server database,any idea to connect to server using active directory like most client server application do.
thank for any help

Client Server Application
Hi,
i want to make a client server software. kindly give me any idea and instruction.

thanks

Need Help With Client-server Application
Ok, I am using some source code that I got online from:
http://www.mentalis.org/vbexamples/l...ategory=SOURCE

The code is in the intermediate section titled server-client.

I need to know how to use this connection to use a database on the server side. Anybody know?

Client-server Application
hi!
till now i have developed desktop application but now i like to know how to develope client-server application using vb as front-end and sql server as front end
i also like to know this in detail ,so please help me out

Client/server Application
Can anyone point me into the right direction to find information on this? -- I have a program that is only designed for a single user, and I need to convert it into the client part of a client/server application. This client will obviously be on multiple computers accessing the same server. How do I handle all the users and be able to deal with them separately on this server. I know that in C++ I can just use threads, but I don't want to rewrite the program in a new language (time crunch). Each client will be extracting data from a database, and I need to know who is who becuase they will be having live data sent to them as it is updated on the server. Please Help!?!?!

Client/server Application
Hello all,

Good day to all! i need help a suggestion , solution or any code on how to
established a connection for client/server application.
For example:

***This is for remote IP

Remote IP: 192.168.2.55 ' this is the remote ip address
Remote Port: 12005
User Login: username
User Password: password
Database Name: dbname

***This is for remote Host

Remote Host: http://192.168.2.55
Remote Port: 12005
User Login: username
User Password: password
Database Name: dbname


Any suggestion or solution? Pls.

Thanks all
Joseph

Client/Server Application
Hi,

I want to develop a client/Server Application using Microsoft Winsock activeX control.

I want to save a record in a database whch is allocated in a server.

is there anyone to help how to go about?

Yor help is most appreciated.

RPK

Client/Server Application In VB6
I am trying to write a Client/Server application using VB6 ActiveX exe. I have two interfaces for the server and two clients. I need to call a method from client1 to fire an event to client2. When I define

Private WithEvents server as clsServer
Private interface as Interface1

Private Sub Form_Load()
Set server = new clsServer
Set interface1 = server
End Sub

Private Sub Client1Event()
interface.FireClien2Event
End Sub

Client1 calls Client1Event to fire an event, client1 can catch the event but client2 does not. This is because both clients created a copy of the server.
What can I do to make this work so that clients can call methods to fire events for each other?

Client Server Application
Client Server Application ...?

Client/server Application
Hi all! i would to develop a client/server application. my question is, instead of i installing the client application in all the computers in the network, can i just install the client in the server and then it would copy ( install ) itself into the computers within the network.

thanx in advance!

Client-server Application
plz..
i have to develop a client and server application in vb which can send and recive data from server

plz help me and show me a way to develop to it



Edited by - manish_khilwani on 3/6/2006 5:02:07 AM

Client- Server Application
Hai

I have a Vb application that runs on the server at a certain port.How do I go about writing a client tool that would enable a browser like Internet Explorer to connect to this application and exchange data.

Regards

Kumar

Client-Server Application
Hi,
Am developping a project using visual basic 6. The application is to work on windows 2000 Advanced Server. The database that will be used is SQL Server 2000. I need to get the Derver name at runtime because the apllication is being developped on another server. Obviously the server name will be different. I forgot to mentioned one more thing about the application...it is going to be shared so that multiple users can use the app. So if anyone can help me plz.

Thanks in advance,
Yours Sincerely




Edited by - duncan on 3/29/2003 12:04:49 AM

Client Server Application.
Hiii,
I have to develop a client server application using VB and SQL Server,I would use ADO.I have to make an online admission system where around 10 students can be given admission at a time for some specific college and course, after checking that whether seat is availabe in that college for that course or not.10 clients will access database(they can request to add,update,delete data) placed on a server.The whole database will be placed on server only.What are the major points I have to take care of for creating this application.Plz tell me that which cursor(eg. adOpenDynamic/adOpenStatic cursor in client side application) and lock type(adLockBatchOptimistic/optimistic lock in client application) I'll have to use for:
1. Add record (by one or many users at different or at the same time)
2. Update same or different record(by one or many users at different or at the same time)
3. Delete record under same situation.
If A,B,C,D are users.Can the record can be viewed by any no. of users(clients) without any problem?But how to restrict other users(B,C,D) to update/add/delete a specific record if that record is being used by a user(A)?And processing should be fast without getting an error/corruption of database/data duplicacy/data redundany. what about transaction handling?
I have worked only on desktop application using VB and SQL Server..At what points this client server application will be different from desktop application??Please help me in this regard..Its urgent for me.

thanx
mamta

Client Server Application
Hi EveryBody ;


I have an internet cafe i want to create a client server application thats allow me to controll clients machine ( Start using the machine , restart , shutdown , restrict access to some windows features ) and will try to coonnect this software to a database which will help me to improve the finantial operations for my cafe .

any one have any idea about doing this , e-book , or sample programe for this ?????

my email : firas_th@hotmail.com


Best Regards

Client/Server Application Using API
I need some information/code regarding client/server application using APIs. I want to develop an application which resides on server and creat a log file(text file) in which it keeps track of every user's Time, Date, User Name, IP Address, Maching Name and log off time. All the recrod should be in text file or in any othre format. So anybody can help me ? Thanks

Client/Server Application
Hi,

I was developed an application using VB5.0 and MSAccess97. Now this application running on a PC. It is connected with network. I want give access to this application other machine also. All machine on the Network. I was using the opendatabase menthod for opening database and openrecordset method for opening recordset.

I want how to develop a client/server application. Anyone have any ideas about this concept pls send mail.


Thanks

Regards

Siva

Winsock Server/Client Chat Problem
Here is something i have been working on (took me 15 minutes and you'll see why):

This is Client Side:

Code:
Private Sub Command2_Click()
Dim strData2 As String
strData2 = Text2.Text
Winsock.SendData (strData2)
Text1.Text = Text1.Text & vbNewLine & Text2.Text

End Sub


Private Sub Winsock_ConnectionRequest(ByVal RequestID As Long)
' if the socket is open, we have to close it. This is
' because if you try to use a socket for more than one
' thing at once, it will cause an error.
Winsock.Close
' now we can accept the new connection
Winsock.Accept RequestID
End Sub

Private Sub Command1_Click()
' set up the Winsocks remote computer properties
Winsock.RemoteHost = "127.0.0.1"
Winsock.RemotePort = 10101
' start the connection
Winsock.Connect
End Sub


Private Sub Winsock_Connect()
' alert the user to whats happened
MsgBox "Connected"
Label1.Caption = Winsock.State
End Sub

Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Winsock.GetData strData
Text1.Text = Text1.Text & vbNewLine & strData
End Sub

Private Sub Winsock_Error(ByVal Number As Integer, Description As String, _
ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, _
ByVal HelpContext As Long, CancelDisplay As Boolean)
' alert the user to whats happened
MsgBox "Error: " & Description
End Sub

This is server side:

Code:
Private Sub Command1_Click()
Winsock.SendData (Text2.Text)
Text1.Text = Text1.Text & vbNewLine & Text2.Text
End Sub

Private Sub Form_Load()
' set the socket's local port
Winsock.LocalPort = 10101
' listen on this port
Winsock.Listen
End Sub

Private Sub Winsock_Connect()
MsgBox ("Connected!")
End Sub

Private Sub Winsock_ConnectionRequest(ByVal RequestID As Long)
' if the socket is open, we have to close it. This is
' because if you try to use a socket for more than one
' thing at once, it will cause an error.
Winsock.Close
' now we can accept the new connection
Winsock.Accept RequestID
End Sub

Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim strData As String

Winsock.GetData (strData)
Text1.Text = Text1.Text & vbNewLine & strData
End Sub

Now, Server listens and everything connects nicely with no forcefull rejections. Server can send text to client, however anything that teh client sends to the server is lost before it ever gets to the Servers Data Arrival event. Any Ideas would be appriciated. Already tried to double connect them. And i know it isnt the DoEvents code. This is a demo i am doing from a friend with code form winsockvb.com. Thank you.

Client Server Winsock Disconnection Problem
Hi folks, I could really use some help here.

I've made a Client/Server program that generally works great. I run the server off of my computer and others connect into it using the client I made. However, a few of the people that are using the client are having trouble staying connected. They'll connect fine, but after various lengths of time the client just disconnects - sometimes it's a few minutes, other times its hours.

I tried using a timer (in the client) to solve the problem:


Code:
Private Sub tmrConnectStatus_Timer()
If Winsock1.State <> 7 Then
cmdConnect_Click
End If
End Sub

However, this didn't help. The strange thing is that the majority of users have no issues at all. But I'd venture to say about %20 of them do have this problem.

If anyone has any ideas as to what might be happening here, I'd greatly appreciate any help.

Thanks

Passing Data Server App To Client App Using Winsock
i want to make a client/server application similar to chats... which pass string data, which is, i think, a bit easy.

my problem is this..:
can i? if i can, how do i pass data other than those set by type?

Settings

The settings for type are:

Description Constant
Byte vbByte
Integer vbInteger
Long vbLong
Single vbSingle
Double vbDouble
Currency vbCurrency
Date vbDate
Boolean vbBoolean
SCODE vbError
String vbString
Byte Array vbArray + vbByte

specifically objects, such as recordsets?

is my question clear?

maybe i'm asking for a code... using control or API

Winsock: Creating Server / Client Applications - Help Please!
I'm going to start on a rather big project that invloves Server / Client communication in VB, and I need some hints or pointers on this matter.

My experiences with Winsock haven't been good, regarding that it sends data whenever it wants to, and not when I want it to. In my last application, i sent "commands" to the server in the form of strings (i.e. "LIST IN Argument1 Argument2 SomeLongArgumentOfSeveralK3"), anyway.. the problem was .SendData didn't send it as I wanted it to, it sent the packets randomly and as it saw fitted best... Not only that, but it truncated my packets so the server would sometimes recieve only half the command (making it crash, since there was no error-handling for an error that never was supposed to happen. I'm building the client as well, so all commands should work. Of course, I never counted on Winsock giving me such a hard time.)

Anyways, I realised later on I could get somewhat more accurate sends and recieves by ending every "command" with a VbCrLf... Then buffering packets and checking for VbCrLf at the Server.. Which of course made things difficult when "SomeLongArgument" conatined line breaks. So I had to replace all line breaks by som pre-defined char i hoped would never be used and on the server Replace() that char back to chr(13).

Eventually I added error-checking, which would make the app send a crc back to the server/client and wait for an acknowledge that the packet was recieved ok, otherwise request a resend.. (I though TCP had this built-in?) Well you can imagine the hassle... At the end, Winsock still managed to crash either the Server or the Client one way or another...

Anyways, i'm doing a serious project and i dont have time for these "ugly fixes".. Is VB Winsock suited for Server / Client applications? Or is there another better way (more reliable, built-in error checking would be great as well).

Also, any tips on how to better create the "command packets" containing the data?

Any comments are greatly appreciated!

Client/server Apps Using Winsock Problem
im a doing a client/server apps.. one server and one client.

just asking if what code should i write if want to know the path of the server?

if im on the client, i use the <App.Path> to know the path of the application.. But how about about the path of the server when im on the client?? help please?

Multithread Multiuser UDP Winsock Client/Server
Can someone please direct me to an example like this. I have to use UDP because tcp is slow at sending packets. And I'm not too sure on how to use udp.

I know it needs no connection but I've just been having problems sending data to the right computers.. I can't explain. can someone show me an example of like a chat that uses multiuser udp. Like I only need to send data to one person for things like private messaging and it seems udp is sending the data to all persons..

please help
thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved