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




Winsock Server Connection Request Problem


hey, this is my code


Code:
Private Sub wskServer_ConnectionRequest(ByVal requestID As Long)
Dim msgboxResult

msgboxResult = MsgBox("A connect request has been initiated by: " & wskServer.RemoteHostIP & vbNewLine & "Would you like to accept it?", vbYesNo, "Connection Request")

If msgboxResult = vbYes Then
wskServer.Accept requestID
isServer = True
End If
End Sub


now the problem is, whenever i run it, and have a client try to connect to it, this is the error the server gives me on this line "wskServer.Accept requestID"

---------------------------
Project1
---------------------------
Run-time error '40020':

Invalid operation at current state
---------------------------
OK
---------------------------

can someone help?


EDIT: and yes, i did try:
wskServer.Close
wskServer.Accept requestID

but it doesn't work. if u need 2 see my whole code to know whats going on, just let me know




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Winsock Array Connection Request
i made a post a couple days back gavino answered
im trying to make my multi chat program and well, it isnt goin by too well. for starters the client cant connect

Code:
Private Sub sckSocket_ConnectionRequest(Index As Integer, ByVal requestID As Long)
SockNum = SockNum + 1
Load sckSocket(SockNum)
sckSocket(SockNum).Listen
sckSocket(SockNum).Accept requestID
End Sub
is there sumthing wrong with that?

WinSock Connection Request Error!
When I use this code for a winsock connection request:

Code:
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
txtRecive.Text = txtRecive.Text & vbCrLf & "ChatX: Connection Request Detected."
End Sub


I get runtime error 40020:
Invalid operation at current state

when I hit debug it highlights that code snippet up there! HELP

Winsock Connection Prob: "Request To Connection Time Out".
Hi All,

I am developing chat application like Yahoo and MSN messenger. Also i have almost completed it. I have two applications one is server appliation which will be run on chat server machine. the other is client appliation which will be used at any corner of the world.

Its working fine on my network. Ya, it is also working fine over network but with some misbehaviour. Sometimesm, it allow someone to login and sometimes it doesn't and gives "Request to connection time out" error.. I can't find the reason y it is happening.

I have developed this in visual basic and used winsock control.

Winsock Connection To Server
When i click on the connect button, i would like to establish a connection to the server and send a data to the server.

My question is

1) what does the sckClient.state do ? and under wut surcamstances only the sckClient.state = sckConnected ?

2) How can i ensure that the data is send to the serveR ??? I face a problem of sending data to the server. It does not execute the sckClient.SendData . How can i do so that the sckClient.SendData can be executed ??




VB Code:
Private Sub cmdConnect_Click()    sckClient.Close    MsgBox "You are connected to " & txtPCName.Text    sckClient.RemoteHost = txtPCName.Text    sckClient.Connect With sckClientIf .State = sckConnected Then        .SendData "~@" & "UserName" & "~~" & txtName.Text & "~*"    Else         MsgBox "Problem with Connection: Probably not connected", vbCritical, "Error! With Connection"Exit SubEnd IfEnd With  End Sub

Winsock Server Connection Info
I currently have a working winsock server working, but as of now.. all it is, is a blank form. Are there anyways to add anymore information onto that form about the connection status of the server? Such as bytes sent, speed, connected clients, anything? Here is my current coding.


Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = (vbKeyQ) Then
End
End If

End Sub

Private Sub Form_Load()
Winsock1(0).LocalPort = 10101
Winsock1(0).Listen
End Sub
Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal RequestID As Long)
Load Winsock1(Winsock1.Ubound + 1)
Winsock1(Winsock1.Ubound).Accept RequestID
End Sub

Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim i As Integer
Dim data As String
Dim Users As String

Winsock1(Index).GetData data
For i = 0 To Winsock1.Count - 1
If Winsock1(i).State = sckConnected Then
Winsock1(i).SendData data
DoEvents
End If
Next i

Winsock1(Index).GetData Users
For i = 0 To Winsock1.Count - 1
If Winsock1(i).State = sckConnected Then
Winsock1(i).SendData Users
DoEvents
End If
Next i


End Sub
Thx

Winsock Client/server Connection Problem
I have created a client/server chat app in vb6, when I tried it in my pc it works fine, the client app can connect to the server, but when I tried it with my friend through internet the client cannot connect to the server. So I tried changing the port on both app to 80 and the client app says it is connected but in the server side it is not connected. We are both using dial up and and the IP is correct. Please help me with this problem. Thank you in advance.

*RESOLVED* Winsock Server Detect When Client Drops Connection
Is there any way for a winsock server to detect when the client drops the connection so that I can put it back to the Listening state.

I have a client connected to the server and all runs OK.
In my testing I am simulating the situation where the client app crashes and is then run again and wants to re-establish the connection with the server.

However, I get error 10061 (connection forcibly rejected).

Any help greatly appreciated.

Winsock Programming: How The Server Side Releases The Connection With A Client?
If the client is already offline (means that it has disconnected), then how the server side detects and releases this connection?

Winsock Programming: How The Server Side Releases The Connection With A Client?
If the client is already offline (means that it has disconnected), then how the server side detects and releases this connection?

Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on planetsourcecode.com but there's a few things that aren't working.

Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect domain.com 80).

GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever
Referer: www.whatever.com

But when I used the website http://ipid.shat.net/ as the domain to see if code mdified the headers or not, it directed me instead to just www.shat.net. How would a browser request information to ipid.shat.net?

Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.

Connection Request
Greetzzz,

I am working with a client and a server. There is no problem when i connect to the client , but when i close the server, and try to run it again ( button: connect) i get the error , the connection is forcefully rejected.

on the client side i have:

[vbcode]
Private Sub Winsock_ConnectionRequest(ByVal RequestID As Long)

Winsock.Close
Winsock.Accept RequestID
end sub
[/vbcode]

on the server side:
(with or without, it doesn't matter)

[vbcode]
Private Sub Form_Unload(Cancel As Integer)
Winsock.Close
End Sub
[/vbcode]


It is only when i close and rerun the client that i manage it to work

Connection Request Interception
how do i Intercept Connection Requests made by Yahoo Messenger and relay the Packets between the client and the server?

anyone?

What Happens To Clients Request Connection At The Same Time?
lets say there is one client that request a connection with a winsock at the same time or... with very small time differences... what happens to the following event:



VB Code:
Private Sub oSocket_ConnectionRequested(ByVal requestID As Long)    'lets say here I have the code   'to accept the call and pass it to another EXE process but    'before  this.. another ConnectionRequest arrives....    'will it wait until this sub is over.. or will it interrup it? end sub

Winsock Request
I have a Winsock component setup right now on my network, exact same as whats in this thread

I would like to know if a similar control can be built using Winsock to do this:


1) Connect to a remote computer, by IP address. (I have a code that determines the IP address of the remote machine already..)

2) Open a .txt file, send it back to (my) the users computer and displays it in a text box on screen.

3) On command button press, take what ever is in my text box, and send the file back to the remote computer and save it.

Kind of like editing a configuration file, remotly.

I know the application would have to be running on the remote end as well as my end for this to work, if its at all possible.

I would really like to do this, I appeciate everyones help in advance!

Winsock Example Request
I'm at work where I can't get to any help files for winsock.  Can somebody give me a quick example of the code required to create a winsock instance, including telling it to listen and respont to internet requests?  I'm going to attempt to make MS Access act like a simple server, and I just don't have the resources here to get it running.  Thanks!

Winsock HTTP Request Help
I need help with this, my wrapper uses winsock to send requests and the close event does not fire which makes the connection stay open forever, my wrapper is at the bottom it is a attachment

WinSock Request Accept
Hey,

I have been trying to get this code to work, It's most likely something stupid am doing, but i cant get my server program type thingie to accept the Request ID from the client program thingie... Here is the code to the part that it says is wrong (If you need anyother parts tell me an i'll post it)


Code:
Private Sub HostSocket_ConnectionRequest(ByVal requestID As Long)

'Show Request In Host Log
HMsg = "Connection request id " & requestID & " from " & HostSocket.RemoteHostIP
HostLog.AddItem (HMsg)

sRequestID = requestID
iSockets = iSockets + 1
ConNumber.Caption = iSockets
Load HostSocket(iSockets)
HostSocket.LocalPort = 1007
HostSocket.Accept requestID

End Sub
PS. I looked at an example to help me with this, so am not sure whats wrong.

Thx in advance.

Ali.

Can Winsock DLL Do Other Protocol Request ...
guys,

i find that the winsock OCX really is limited in its capability...
can anyone suggest me a better one for network programming? because the protocol type is limited to a few only....

I hope to do RTSP / RTP request ... is there any thing that i can used to do that ???

can Winsock Dll do other protocol request or its the total same with the winsock OCX?

Does anyone has a sample using winsock DLL (as client)...??

Winsock : GET Http Gives Me Bad Request , Why?
guys,

is the statement below wrong??

GET http://www.hypermart.com HTTP/1.0


the dataarrival shows me error message...

400 BAD Request

can anyone justify this please?

Multiple Request With Winsock
Greeting,

I have a little problem with winsock. I have a server and several
client. I want to transfer text from server to client trough the network
In this case, I using winsock to transfer the text. It is ok when only 2
computer connected (1 server and 1 client). But, when 3 computer
Connected (1 server and 2 client) I cant broadcast text to all client.

Does any body know how to broadcast text fom server to client trough the
network and winsock?

thanks

Rgds,
Rano Nugrah Agung Homan

Winsock Sample Request
Hi all,

I need to make a server app for my project. I have concluded that I will need to implement Winsock to do so. I have read up on all Winsock articles here (and many others elsewhere) and have downloaded and studied all the samples I could find.

However, I am unable to do what I want because:

- The tutorials say that the IP address or friendly name of the target computer MUST be specified for the Winsock control to connect on the other side. This strikes me as very backward, as I can not always know what IP addresses my customers' network stations will be running on and cannot also predict their friendly names. Does this have to be hard-coded?

- Try as I may, I cannot create a working sample of Server.Exe and Client.Exe to run on the same machine as I cannot afford the luxury of testing my code over two machines. Is there any way I can debug / test on one machine?

If any member proficient with Winsock (Laura Stephens and Jason Rogers come to mind) would like to help, I shall appreciate a small sample to get me started by solving the above two problems.

GoodGuy
Experience is a bad teacher for its exams precede its lessons.

Edited by - GoodGuy on 12/10/2007 10:23:30 PM

VB Server Request
Hi....
I'm attempting to write a small server diagnostic tool that requests a page from a given URL every set interval. Can anyone tell me what control I should use ... I've tried the INET and Microsoft's Winsock control. They seem OK but the problem is that there's nothign about them in the MSDN library, and I don't know how to use them.

Any help would be greatly appreciated.

James Sadlier

[VB6] Winsock POST Request Problem
I'm trying to connecto to google.com and translate a simple word (just to test if works).

And I have a problem when I'm sending POST request data, here is my code:


Code:
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "www.google.com", "80"
End Sub


Private Sub Winsock1_Connect()
Dim packet As String
Dim strpost As String

strpost = "hl=it&ie=UTF8&text=hello&sl=en&sl=en&tl=it&tl=it"

packet = "POST /translate_t HTTP/1.1" & vbCrLf
packet = packet & "Host: www.google.com" & vbCrLf
packet = packet & "Accept: */*" & vbCrLf
packet = packet & "Accept-Language: it,it-it;q=0.8,en;q=0.5,en-us;q=0.3" & vbCrLf & vbCrLf

packet = packet & "Content-Type: " & "application/x-www-form-urlencoded" & vbCrLf
packet = packet & "Content-Length: " & Len(strpost) & vbCrLf
packet = packet & strpost

Winsock1.SendData packet

Text1.Text = Text1.Text & packet

End Sub


Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String

Winsock1.GetData data
Text2.Text = Text2.Text & data & vbCrLf

End Sub



As you can see I want the GETDATA in Text2.Text but I recieve this error:


Code:
HTTP/1.1 411 Length Required
Date: Fri, 01 Aug 2008 13:57:24 GMT
Content-Type: text/html; charset=UTF-8
Server: GFE/1.3
Content-Length: 1357

{html code}


What's the problem?!

Thanks in advance.

How Can You Request A Webpage Using Winsock And HTTPS?
HTTP is easy to form requests with using winsock..
but how can you make requests to a https site?

Wrong Protocol Or Connection State For The Requested Transaction Or Request....
I wrote a small application. It has 2 forms, one which listens on port 5555 and one that sends to it. Form1 listens to it and expects to recieve a byte array and insert it into a udt and print out the values of the variables in the udt on a label. In Form2 the data values are inserted into a byte array which is then sent to port 5555.

When I try to run this application, I get runtime error 40006 "wrong protocol or connection state for the requested transaction or request".

Can someone please look at the code and tell me what i'm doing wrong?

Thanks.

Request SOAP Server
Hello,
I want to request a SOAP server.
How can i do that?
Kindly, Can anyone give me an example for that subject?

Best Regards

Request Data From Server....
I am making a really big chat program with my friends but i need some help. The problem is, is that when i run a server and get the client to connect to it and recieve data from the richtextbox it doesn't get anything , it just leaves an empty text box. Here is the code:

Client:
Code:
Option Explicit

Private Sub cmdrefresh_Click()
GetList.Connect ServerIP, ServerPort
GetList.GetData ServerList
cmdrefresh.Enabled = False
mnurefresh.Enabled = False
cmdStop.Enabled = True
mnustop.Enabled = True
End Sub

Private Sub cmdStop_Click()
cmdrefresh.Enabled = True
mnurefresh.Enabled = True
cmdStop.Enabled = False
mnustop.Enabled = False
End Sub

Private Sub Form_Load()
ServerIP = "192.168.1.4"
ServerPort = 21
cmdStop.Enabled = False
mnustop.Enabled = False
End Sub

Private Sub GetList_DataArrival(ByVal bytesTotal As Long)
GetList.GetData ServerList
lstServers.AddItem ServerList
End Sub

Private Sub mnuexit_Click()
If MsgBox("Exit", vbQuestion + vbYesNo, "Exit") = vbYes Then
End
End If
End Sub
Server
Code:
Option Explicit
Dim ServerList As String

Private Sub Command1_Click()
ServerInfo.Text = ServerInfo.Text + txtin.Text
End Sub

Private Sub Form_Load()
ServerList = ServerInfo.Text
Server.LocalPort = 21
Server.Listen
End Sub

Private Sub Server_ConnectionRequest(ByVal requestID As Long)
If Server.State <> sckClosed Then Server.Close

Server.Accept requestID
Server.SendData ServerList
End Sub

Private Sub Server_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 "oops"
End Sub

Your help would be greatly appreciated.

Viewing Cookies Sent With Either Winsock Or INet Request?
Hello,

Is there a way that I can send a request via INET (Most Likely), and read the cookies which were sent with that request?

Thanks

Winsock/cookie Request Entity Too Large...
hi i'm sending a cookie header via winsock but i think it's to large cause I'm receiving a "Request Entity Too Large" in the HTTP Response. is there a way around this?

Winsock - Notification When User Accepts Request
Does anyone know of a way that an initiator of a Winsock connection can be notified when a user on the other end accepts the connection ? I'm new to Winsock, so my terminology might not be the best, but I'm trying to find out if the inititator has any way of knowing that a connection was made before any messages are exchanged?

Thanks for any help....

Does Anyone Have An Example Of How To Send A POST Request With Winsock And A Proxy?
I know how GET works with winsock and a proxy, but how can you use a proxy and use POST?

anyone have an example?

How To Run An Application From Server By Client Request
Hi,
may i ask you a simple (or complicated?) question.

how can I create an server-type application (or just a simple application)
which would be run only from server according to Clients requests.

In other words, how to avoid installation software/application on each network computer and run the application on it from server, i.e. create instances
of it on each computer and receive resulting data on server?

Thank you in advance,
Shab

sd12ru@yahoo.com

HELP: Winsock To Send HTTP POST REQUEST To A Machine
Hello,

I would like to use visual basic to send data to a machine using an HTTP Post request, and cannot decide on the best way to do it. Can I use winsock. Please bear in mind the following.

I am sending a mult-part message (kind of like an email with attachments). It's actually a multimedia message in the MM7 format -> this is similar to email, a multipart MIME message.

I MUST post to a destination using the following format:

http://192.168.3.75:2097/mm7

I need to then send the data which I've formated according to the MM7 spec.

I need to receive responses from the receving application.

Any help would be greatly appreciated.

Thanks

Ben

Component Request Pending On Server Connect
Hey all,

I am writing a small app that uses a reference to connect to a server. While it connects and logs in, my app becomes unresponsive because it is awaiting status update from the component im using to connect to the server. Is there a way to make it so that my application will continue to work while it is connecting so that I can continue verifying its status and the user can continue to work within my app while things are happening in the background?

Thanks!

-Quack!

[Web Services] Server Receives GET Request Instead Of POST
I apologise for posting in this forum but I did not find another one more appropriate.

I am using SOAP SDK like in both client side and server side of a Web Service based application.

When I call the WS from a client machine (windows 2000/xp) the server receive a POST http request like expected but when I call the WS from anothers (windows nt 4.0) the clients sends a GET request and perhaps the server dont respond with the method invocation result (it responds describing the wsdl file). The client application is very simple and I do not understand where the difference arises.

In all machines (w2k prof/xp/nt acting like WS clients and w2k server acting like WS server) are installed the MS SOAP Toolkit 3

At the request sent by the NT machine also is missing the SOAPACtion header

Have any idea because the NT machines sends GET request instead of a POST one?

Thanks in advance

windows 2000/xp

POST /WSSAM/LPSamWS.WSDL HTTP/1.1..
SOAPAction: "http://tempuri.org/LPSamWS/action/LPSamWS.VencimientosPendientes"..
Content-Type: text/xml; charset="UTF-8"..
User-Agent: SOAP Toolkit 3.0..
Host: 172.16.0.29..
Content-Length: 1188..
Connection: Keep-Alive..
Cache-Control: no-cache..
Pragma: no-cache....
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAPSDK4:VencimientosPendientes xmlns:SOAPSDK4="http://tempuri.org/LPSamWS/message/">
<bstrMsgXMLIn>blahblahblah
</bstrMsgXMLIn>
</SOAPSDK4:VencimientosPendientes>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>.


windows nt

GET /WSSAM/LPSamWS.WSDL HTTP/1.1..
Host: 172.16.0.29..
Content-Length: 1188..
Connection: Keep-Alive..
Cache-Control: no-cache..
Pragma: no-cache....
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAPSDK4:VencimientosPendientes xmlns:SOAPSDK4="http://tempuri.org/LPSamWS/message/">
<bstrMsgXMLIn>blahblah
</bstrMsgXMLIn>
</SOAPSDK4:VencimientosPendientes>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>.

Active Server Pages - Request Object
Hi,

I am looking through some ASP and trying to determine where an item of data is coming from.
There is a stock ASP object called 'Request', which has a collection called 'Server.Variables'. Ihave take a look on MSDN at a list of predefined variables that apply, yet the one i am looking for is NOT in the predefined list and taking a search through all my .asp and .js pages fails to show where it is being defined.

I am trying to determine where the variable HTTP_HOST comes from. This is how it looks in my asp pages ...

Session("DLAM").HostPath = "http://" & Request.ServerVariables("HTTP_HOST") & "/oasis/uk/images/"

Now, HTTP_HOST returns the name of the server upon which IIS is running, but HOW does it get set ? Where does the value come from ?

MSDN states ...


HTTP_&lt;HeaderName&gt; The value stored in the header HeaderName. Any header other than those listed in this table must be prefixed by HTTP_ in order for the ServerVariables collection to retrieve its value.
Note The server interprets any underscore (_) characters in HeaderName as dashes in the actual header. For example if you specify HTTP_MY_HEADER, the server searches for a header sent as MY-HEADER.


... but i do not understand what it means when it talks about 'headers'. Can somebody please help me determine where I might find where HTTP_HOST is being set ? Have you come across it before ? If it's NOT a stock variable then erhaps you could give me some pointers on how these headers work and how asp determines what HOST is, because it is never 'Set' in the code!

Thanks for your help, sorry for the long post.

Jase


&lt;no witty trailer supplied&gt;

Winsock State 8 - Peer Closes The Connection Leaving Winsock High And Dry
I am debugging some web/proxy-serving code. I am stumped.

I get Winsock state 8 - Peer is closing the connection
Then Winsock error message wrong protocol or connection state.

It seems to me that Winsock closes before it can finish sending all of its data.

How can I keep Winsock in state 7 - Connected?


Thanks...

VB & SQL Server 6.5 Error - Request Properties Cannot Be Supported By ODBC Driver
My team has built a VB interface to batch load records to a SQL Server 6.5 database on a web server we are getting the error message: The Request properties cannot be supported by this ODBC driver. error number -2147217887 or in hex 80040E21. We choose the to continue the app continues on its merry way without ever getting that error again. We are running the app over a large corporate network within our firewall. Does anyone have any suggestions or know why this might be happening?

How To Disable Connection Pooling From SQL SERVER, Not Thru Connection String
my friend has getting "SQL Server Does Not Exist or Access Denied" and it is related to TCP-IP , now i want to simulate that error on my m/c so i need to off the connection pooling.
Plz advise for disabling connection pooling (not thru connection string)

Connection To Database Sql Server In Server Failed
i use crystal report 8.5(crviewer to create report) in visual basic 6 and database using sql server . i use ODBC to connect to a database sql server in server and i want to use stored procedure in database sql server to make report.
my problem is connection failed and message box ' connection has not yet been open'.
why? help me

Winsock Connection Prob: "Attempt To Connection Time Out".
Hi All,

I am developing chat application like Yahoo and MSN messenger. Also i have almost completed it. I have two applications one is server appliation which will be run on chat server machine. the other is client appliation which will be used at any corner of the world.

Its working fine on my network. Ya, it is also working fine over network but with some misbehaviour. Sometimesm, it allow someone to login and sometimes it doesn't and gives "Attempt to connection time out" error.. I can't find the reason y it is happening.

I have developed this in visual basic and used winsock control. Any idea regarding this may help me out.

How Could I Treat Vb Button As "Submit" To Send Request To ASP Web Server?
I have basic knowledge for ASP. I could create a "Submit" input to send request to ASP web server. But if someone can tell me how could i let vb application button to do this kind of job. It's better there's document i can read. Thanks!

SQL Server: Not Associated With A Trusted SQL Server Connection
I've installed SQL Server 2k Personal on another WinXP Pro computer in my room. I can ping this machine fine from this computer. Password for 'sa' has been changed.

In 'Query Analyzer' on the client, the server's computername (SLOWCOMPUTER) shows up on the dialog box by itself, so I know it's responding. For the connection I'm using 'sa' and the correct password, however, I'm getting the following error after pressing OK:


Quote:





Unable to connect to server SLOWCOMPUTER:

Server: Msg 18452, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for 'sa'. Reason: Not associated with a trusted SQL Server Connection






I have not idea how to correctly setup the server - I'm just wanting to get a better grip on ADO.

Any suggestions?

Can You Use A Web Server As A Host For A VB Winsock Server?
Can you use a web server as a host for a VB winsock server?

I have an AOL Instant Messanger look a like app. I have a server and client projects. I would like to setup the server app on my website(hosting through online company) so that other people that are using the client app can always connect to the server app...

Possible?

Thanks.

Winsock Connection...
ok, im trying 2 make a little instant messenger sorta program, anyways, i have it set up with a radio button so that u either choose to accept messages (server) or send (client). When u press accept and click connect it should just set the local port on winsock1 to whatever the text box for local port is (1412 is what im using). when u press send messages and press connect, it should connect to the ip u entered using the port u entered (127.0.0.1, and 1412). Ok, now, if i make it an exe, open it twice, and set one to be the server and the other to be the client, and presss connect on both, the state of the server side is 0, and the client side goes from state 6 to state 9 (im not sure what these 2 are, but i know 7 is connected). I cant get it to connect to the other program thats open, ill post my code below... and also, if i set the local port on the winsock to port 1412 and connect to port 1412 the program works fine (im doing this without opening the program twice). and i can send messages and all, however it needs to work if some1 were to open the program on different computers. im just gonna post my code for the main form, since the other 2 just tell it to send messages (which work fine if its connected). Hopefully some1 will b able 2 help me out!


Code:
'Declare Variables
Public blnListening As Boolean
Public strMessageTaken As String
Public blnReady As Boolean

'Connect
Private Sub cmdConnect_Click()
If blnListening = True Then
Winsock1.LocalPort = txtLocalPort.Text
frmServer.Show
cmdConnect.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
txtLocalPort.Enabled = False
txtName.Enabled = False
blnReady = True
End If
If blnListening = False Then
Winsock1.LocalPort = "0"
frmClient.Show
cmdConnect.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
txtIP.Enabled = False
txtPort.Enabled = False
txtName.Enabled = False
Winsock1.Connect txtIP.Text, txtPort.Text
blnReady = True
End If
End Sub

'Close Connection
Private Sub Close_Click()
Winsock1.Close
frmClient.Hide
frmServer.Hide
cmdConnect.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
txtIP.Enabled = True
txtPort.Enabled = True
txtLocalPort.Enabled = True
txtName.Enabled = False
blnReady = False
End Sub

'Load Form
Private Sub Form_Load()
Winsock1.Close
If Option2.Value = True Then
blnListening = False
Else
blnListening = True
End If
txtName.Text = Winsock1.LocalHostName
End Sub

'Exit
Private Sub Label8_Click()
Unload frmClient
Unload frmServer
Unload frmConnection
End Sub

'Listening Options:
'xxxxxxxxxx
Private Sub Option1_Click()
If Option2.Value = True Then
blnListening = False
Else
blnListening = True
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
blnListening = False
Else
blnListening = True
End If
End Sub
'xxxxxxxxxx

'Peridoc1
Private Sub Timer1_Timer()
frmConnection.Caption = "Connection: " + LTrim$(Winsock1.State)
lblYourIP.Caption = RTrim$("Your IP: ") + Winsock1.LocalIP
End Sub

'Connection Request
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If blnReady = True Then
Winsock1.Accept requestID
Winsock1.Listen
If Winsock1.State = 7 Then
frmServer!rtbMessages.Text = "Connected!"
frmClient!rtbMessages.Text = "Connected!"
End If
End If
End Sub

'Receive Data
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
If blnListening = True Then
Winsock1.GetData strMessageTaken
frmServer!rtbMessages.Text = frmServer!rtbMessages.Text + strMessageTaken
End If
If blnListening = False Then
Winsock1.GetData strMessageTaken
frmClient!rtbMessages.Text = frmClient!rtbMessages.Text + strMessageTaken
End If
End Sub

Winsock TCP Connection
I need to write a little program to send Unix/linux command to a remote PC by LAN connection. I do it now by Hiperterminal and it works fine. I want to write a program to have help in this way:
in Unix/linux if I send ps -e they show me the list of the active process, if i send cd they change directory and so on..............
Now I want to log in and by pressing some botton in the main panel of my program I want to send the command.
I use the winsock and this code:
Private Sub Command1_Click()
Winsock1.Protocol = sckTCPProtocol
Winsock1.Connect Text2, Text3
End Sub

Private Sub Command2_Click()
Winsock1.Close
End Sub

Private Sub Command3_Click()
Winsock1.SendData Text4 & vbCrLf
End Sub

Private Sub Form_Load()
Dim Instringa As String
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData Instringa, vbString
Text1 = Text1 & Instringa
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 "ERRORE : " & Description
Winsock1.Close
End Sub
When I press connect (port number 23=telnet)I see in the text1 some characters unknow like this:
ÿýÿý ÿý#ÿý'
If I change the port (21=FTP) I see the welcome message. When I use telnet by hyperterminal (by TCP Winsock on port 21)I don't have this problem......How I can translate it?
I'm sorry for my bad english .Thanks!!!

Winsock Connection Que?
Can someone give me an example of how I would make a client-server program, that the client is in a que and has to wait until its his turn?

Winsock Connection Help
i just get an overflow...

nvm i got it.

right now with this...




VB Code:
Private Sub Command1_Click()Dim x(3) As Datax(0) = &H4x(1) = &H0x(2) = &H89x(3) = &HCWinsock1.SendData (x)End Sub


this worked last time i tryed..now it wont work im sending data as u can see im sending it as HEX

and i get an error..

and... i need to connect to the server and a client..the server connect's but..the client dont for some reson..



VB Code:
Private Sub Form1_load()winsock1.remotehost = "gsproduc.ath.cx"winsock1.remoteport = 9100winsock1.connectwinsock2.remotehost = "127.0.0.1"winsock2.remoteport = 9100winsock2.connectEnd Sub


that isnt the code i have im using the simple part in the winsock control the custom thing...anyways the code i put there is just 2 tell u what i would have if i was putting it in if u get me. ok now the server connect's but the client dont...(if u must know im sending packets to a game server) this all worked out b4 i had 2 formatt my pc so if anyone can help thx alot

-infamouszero-

Winsock Connection
i'm working on networked computers and trying to connect to the computer beside mine using winsock. when my program starts my state will get to 6 (connecting) but never to 7. no matter how many times i loop through the process i can't make a connection! does anyone know why?

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