Winsock Disconnect Notification
Hi friends,
I am using winsock for sending file from client to server. I was testing it on my LAN. Client and server r running on different pc and connection is established. But suppose i remove LAN connection network chord from client. I m not getting any notification of disconnection, neither on client nor on server and client keeps on sending data to the socket and completes it whereas server keeps on listenning.
How and from where, i can get the notification, what are the window messages or events for that.
pls. reply as soon as possible.. it's urgent.
Thanks in advance.
Regards, sukh
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Tapi Silence Detect Or Call Disconnect Notification
My problem: Using TAPI with a voice modem I do not receive caller disconnect notifications and need a solution to this.
At present I am letting the program capture x seconds of audio then manually disconnecting the call, and ideally I would need to detect the disconnect message from the BT exchange.
Is there any easy way to detect the BT automated three tone disconnect message 'Doh Ray Me "The Other Person Has Hung Up"'..
I am also looking into the talk-spurt detection to save on network and file space, which I could extend this to capture the silence between the hang-up and BT message?
Any ideas / suggestions on these will be most appreciated. as I need to deploy this to a live system for June 20th.
TIA
Is There A Way To Disconnect Winsock?
ok when someone leaves my one on one chat i send a command saying///left the client sees this and then disconnects winsock but how do i do this is there a something like
winsock.disconnect?
Winsock Client Disconnect
Hi all,
I've created a Server Application using Winsock Controls. My problem is when I have 2 clients connected to the server, then client1 disconnects intentionally. I cannot seem to reconnect client1 to the server after disconnecting. I am sure it has something to do with the .state property. But I am unable to get it right. Could anyone help?
P.S. I have 3 apps running as follows:
Client 1
Client 2
Server
Winsock (connect/disconnect)
i have a server and a client part to a program. when the server is running on another computer, i can connect. but i cannot reconnect unless that person reopens the server. Why is this and how can i fix it?
Winsock Error Always Mean Disconnect
I've been developing a server/client implementation over the past few months, and as far as I can tell, everything is pretty solid.
At the moment, my winsock error handling routine consists of a variety of cleanup procedures, and a winsock.close.
However, several users have been reporting unexpected disconnects that only apply to my app - all other TCP programs remain connected, so it’s obviously not an issue with their connection.
The only thing I can think to attribute it to is my winsock error handling routine. Perhaps closing the socket is premature, because maybe a winsock error does not always equal a disconnect.
So that’s my question: Do winsock errors always result in a disconnect, or are some errors negligible? I've looked through the Winsock errors reference, and it doesn't specify what errors are critical, and what ones aren't.
Thanks for your help!
WinSock Disconnect Loop - No Luck ^_^
I have a Disconnect and Connect buttons on top of each other, I want the disconnect one to show when the connect one is pressed. If the disconnect one is pressed. what it does is Leave_connect_loop = true and then shows connect button again. It doesnt work.
VB Code:
Private Sub CmdConnect_Click()Leave_Connect_Loop = False Winsock1.Close Winsock1.RemoteHost = txtHOST.Text Winsock1.RemotePort = txtPORT.Text Winsock1.Connect LblSts = " Connecting to " & txtHOST.Text cmdConnect.Visible = False cmdDisconnect.Visible = True Do Until Winsock1.State = sckConnected DoEvents: DoEvents: DoEvents: DoEvents If Winsock1.State = Error Then MsgBox ("Error connecting. Try again!"), , ":O" LblSts = " Error connecting. Try again later" Exit Sub End If If Leave_Connect_Loop = True Then 'If the user presses cancel then exit the goddamn lOop If Winsock1.State <> sckClosed Then Winsock1.Close LblSts.Caption = " Disconnected..." cmdConnect.Visible = True cmdDisconnect.Visible = False Exit Do Exit Sub End If Loop LblSts.Caption = " Connected: " & txtHOST & " on " & Time Winsock1.SendData (Winsock1.LocalIP & " connected")End Sub
Winsock Network Disconnect-- Urgent
I have two computers A and B. A acts as a server, B a client and they communicate
through Winsock.
A and B check for Winsock state every 5 seconds through a timer.
Now, after they are connected, I pull out the network chord from B.
B detects change in Winsock state ( 7 to 9 ).
A does NOT. It just thinks that the state is connected. Even if I force A to send
messages at regular intervals, it does not show any error. They seem to just
vanish into a buffer or something.
Is there any way to programatically determine the network failure so that A knows B is down.?
Please note that B does not acknowlege what A sends so there is no handshake/echo involved..
Thanks in advance.
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....
Why Does It Disconnect?
Hi, I have a client and a server for a game I'm making. They both send each other data until eventually the client calls DX and loads it on the screen. Then when you hit escape, it calls this sub:
Code:
Sub EndMe()
'Restore the screen resolution.
Call dd.RestoreDisplayMode
Call dd.SetCooperativeLevel(frmGame.hWnd, DDSCL_NORMAL)
'Stop the program:
frmGame.Winsock.SendData "logd¿"
bRunning = False
Unload frmGame
End Sub
But I get this error that says Winsock isn't connected and highlights this line:
Code:
frmGame.Winsock.SendData "logd¿"
Does DX make winsock disconnect? If not, why does it say I'm disconnected?
ISP 2hr Disconnect
Hi all, wondering if anyone had any ideas on a little problem i'm having. I've written a game using DirectPlay, quite successfully, apart from one little problem - my ISP disconnects me after 2hrs, which is very frustrating. Once this happens the game crashes and i'm not sure where, but that isn't what is bugging me.
The question i'm asking is - is there anyway of detecting this and does anyone know of a work around so the player may rejoin in the same place (or as near as) before disconnection occured??
Thanks in advance
Disconnect Aol?
my friend asked me to make him a program that iwll dissconnect him from aol at a certin time, and i'm done except i can't find a function to disconnect from aol.. any ideas?
FTP API Disconnect
I am successfully using the sample code from mentalis.org to process files. Problem is, when I disconnect using the InternetCloseHandle, my FTP server shows that I am still logged in. Its seems I am just cutting the connection as oppsed to correctly logging off. How can I use the API to send the "bye" command or somehow correclty logoff my current session?
Here is my open and close code:
Code:
Public Sub FTPOpen(site$, login$, password$)
'open an internet connection
hOpen = InternetOpen(App.title, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
'connect to the FTP server
hConnection = InternetConnect(hOpen, site$, INTERNET_DEFAULT_FTP_PORT, login$, password$, INTERNET_SERVICE_FTP, IIf(PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)
'create a buffer to store the original directory
sOrgPath = String(MAX_PATH, 0)
'get the directory
End Sub
Code:
Public Sub FTPClose()
'close the FTP connection
InternetCloseHandle hConnection
'close the internet connection
InternetCloseHandle hOpen
End Sub
Thanks,
Rob
Disconnect
Hey,there is there any code out there to disconnect dial up from the net wen i press disconnect then it will disconenct me thank u
Disconnect Net
Can someone give me the code to disconnect internet from the pc?Thanks in advance for any reply.
Disconnect - Reconnect
Why is it always that when i disconnect and try to reconnect to my client / server app, it doenst connect anymore. The first time i have no problems but when i press disconnect on the client side en press on connect again it doenst connect anymore, how do i fix this problem.
How Do I Disconnect From The Internet?
Hello!
I was wondering, how would I make my application drop a dialup connection from the Internet? I am making this application for a friend who wants an internet time monitor.
Thanks!
<font color=red>Alphanumeric</font color=red>
Disconnect From Internet
what is the easiest way for me to simply disconnect my adsl connection. I have to dial up to connect and I would like to be able to disconnect with a click of a button in my program.
Disconnect A Webcam
i was searching the forum but i couldn't find anything about diconnecting a webcam without shutting down the program
anyone know how to discconect a webcam in the program
thx
Disconnect Database
i use a defaul jet engine to connect my access database.
how can i disconnect from database in a form , so i can use filecopy ??
is there a simple command to do that ?
from emidio.
Disconnect A Recordset
I've got 2 database, that are exactly the same. Both of them contain records in the 'Customer' table. Now I want add the records from database1 to database2, but first I want to check whether the record from database1 already exists in database2.
I use the code mentioned here.
rstLocal.Open sqlStr, connLocal, adOpenForwardOnly, adLockOptimistic
rstCentral.Open "SELECT * FROM Customer, connCentral, adOpenStatic, adLockOptimistic
sqlStr = "SELECT * FROM Customer WHERE false"
rstNew.Open sqlStr, connLocal, adOpenForwardOnly, adLockOptimistic
rstDouble.Open sqlStr, connLocal, adOpenForwardOnly, adLockOptimistic
Set rstNew.ActiveConnection = Nothing
Set rstDubbel.ActiveConnection = Nothing
Do While Not rstLocal.EOF
sqlStr = setSQL
Set rstCentral = New ADODB.Recordset
rstCentral.Open sqlStr, connCentral, adOpenStatic, adLockOptimistic
If rstCentraal.RecordCount > 0 Then
addRecToRst rstDouble, rstLocal, tabel
Else
addRecToRst rstDouble, rstLocal, tabel
End If
rstLocal.moveNext
Loop
I want to cycle through rstLocal (database1) and see if a record already exists in database2. When it does I want to add that record to a recordset called rstDouble (which has the same structure and is empty). I don't want to add this to the database, only in the recordset. I know that it has to be disconnected, but somehow I can't figure out how to do that right.
The bold lines give me a 3705 error (Can't perform while object is still open, or something like that). I hope I've made clear what's the problem here. All help is welcome.
Disconnect From A Database
Hi everybody
I made a little application connecting on a database like that:
Code:
Private dbWorkspace As Workspace
Private dbDatabase As Database
Private dbTable As Recordset
'Connect to the DataBase
Set dbWorkspace = DBEngine.Workspaces(0)
Set dbDatabase = dbWorkspace.OpenDatabase("C:DataBase.mdb")
Set dbTable = dbDatabase.OpenRecordset("TheTable", dbOpenTable)
After that I'm able to do some operation on it but I don't know how to disconnect form it without closing the application
Someone know???
Thank you very much
How To Disconnect Adodc?
I have placed some ADODCs in some forms of my VB6 project. These forms are child forms under a MDI container. I am using Sybase SQL Server 11.1.3.1 as backend database. TDB Grid dropdowns are used as bound data control for those ADODCs. In form load event I establish the database connection of the ADODCs via connection string. The recordsource of the ADODCs are changed several times according to the situation during the lifetime of the form. But after unloading the form, those db connections remain unclosed. Additionally, for each refresh method is increasing db connections. This situation is causing enormous open db connections. Is there any way to disconnect the db connections, created by ADODCs, at the form unload event? Unbinding the TDB Grid drop downs doesn't solve the problem. I am using MDAC 2.6. Can anybody help me in this?
USB Connect / Disconnect
Hi,
I'm using a software (not mine) connected to a USB device.
This software should be PERMANENTLY or AS often as possible connected to the device.
The problem is that sometimes the device get crashed :
If i reboot (Start->restart), and i tried to re-connect it doesn't work.
If i unplug the USB cable and plug it back it works !
My question is : If I programmatically unplug/plug the USB : force a new detection will it work and how to do it ?
I really need help ! Thanks !
Dial-Up Disconnect
I'm using the wininet.dll to connect to the net automatically.
How do I close this connections?
Connect / Disconnect From LAN
Hello,
My computer is connected to a LAN. Can anyone please suggest me an API that will allow me to connect and disconnect my computer (internet services, in particular) from a LAN?
Thanks for your time,
Manish
How To Disconnect Internet
i made a program using winsock to send and receive mail from my mailserver.. Automaticly i will get the connection with internet... How i do turn off this connection when i finish reading/sending my mail
you're help will be welcome!!
thanks Ton
Modem Disconnect
Hi all -
I've done a search for my topic - but I haven't found exactly what I am looking for. My question is can you disconnect a modem programmatically?
What I have is an application that has a web browser front end for a weather information system. The end user first dials into a web server using a laptop or desktop, the web server accesses a database server through a LAN which stores road and weather info. What we want is to time out certain users so they don't tie up the phone line. We can time them out of the front end, but we want to disconnect their modem. Some users would tend to "turn the thing on, and walk away", which we are looking to avoid. Is there anyway to kick off their modem? The OS is at a minimum WinNT 4.0
We were told that because of the web browser, there would be no way to kick them off the phone line, short of mechanically doing so. Which would entail us setting the disconnects on a ton of laptops, which could be a logistic nightmare.
Any help, or suggestions for the programmer to try would be greatly appreciated.. as I don't have enough experience to know how to handle this if possible.
Thanks much,
Theresa
Connect To/Disconnect From RAS
I've been searching through the forum on how to trigger
connect to/disconnect from a RAS server. So far I haven't found
exactly what I'm looking for. I need to detect if a connection
exists before disconnecting.
Can anyone give the complete code for doing this?
I'd appreciate. Thanks in advance!
Best Regards,
Resty
B4 Internet Disconnect
Hello All,
I'm working on an app, which needs to send a command in the form of loading an url from a webserver before a user disconnects from the web.
I have made it so that users can disconnect from the web and logoff from the server - providing they do it through my app - but how can I make it so that if they use the windows disconnect, or via another app or even if the PC automatically disconnects... the system will first tell my app to do the logoff before disconnecting from the net? (also allowing it time to complete the operation - just a few seconds).
I haven't got a clue where to start - any ideas?
thanks
Philip :-)
Disconnect ADO Recordset
Every time I try an Addnew method with this disconnected recordset I get an 'Operation Cancelled' message. If I repeat the command it works. It also happens with a movenext call. Microsoft's Knowledge base say it won't happen with a CLientside cursor but it does. I put a loop in and checked for a changed field and end it when the key changes but there must be another way.
This is the code that fixed the movenext problem.
On Error Resume Next
Id = rsPromotions!Id
Do Until Id <> rsPromotions!Id
rsPromotions.MoveNext
If rsPromotions.EOF Then
rsPromotions.MoveLast
rsPromotions.MovePrevious
End If
Loop
Any ideas?
Disconnect In EVB Program
My codes to connect to an IP address is
wskMain.Connect
however, the codes to disconnect is wskMain.Close
anything wrong with that anyway??? but it did not disconnect my eVB program from the server.
Programmers are the laziest people around.
How Do I Disconnect Internet In LAN???
How do i disconnect internet of computers in LAN?? I'm doing it using VB. I have search everywhere but it seems that no one has ever tried to disconnect internet connection which use LAN successfully. Most of it are disconnecting internet which use dial up. Help can somebody help me with this??
Thanks alot
Disconnect & End DHTML
I have two questions
1. How do I disconnect from a remote server using VB6 after a file transfer.
2. How do I end a DHMTL program-eg End for VB6, what is it for DHTML?
Disconnect From The Internet Using VB
Hey!
I can't find a way to disconnect from the internet with a VB 6.0 program.
I tried this http://www.vb-world.net/internet/tip21.html
But VB don't accept the first 5 lines and this part:
Public Declare Function RasHangUp Lib "rasapi32.dll" Alias _
"RasHangUpA" (ByVal hRasConn As Long) As LongPublic gstrISPName As String
Public ReturnCode As Long
Anyone have a way to do this, or corrections for the codes above
Thanks!
Niels
Disconnect Modem Users
Hello,
We have a set of 10 dial in lines to our win32 box, is there some way to disconnect a user based on log-on name using VB?
Thanks Heaps
Rhys :-)
Disconnect Worksheet From Workbook It's In
Hello,
I am doing the following things programmatically:
* pull data from an SQL database into several worksheets
* plot several charts - each into its own worksheet
* make a summary worksheet that contains copies of all the individual charts mentioned above
* publish each individual chart to the web - (intranet)
* the summary worksheet does not get published but needs to be emailed to a list of people
How do I only send the summary sheet as an attachment to an email and not the entire workbook?
One way I was thinking would do is delete all the individual chart sheets and datasheets after the web pages are posted and then email the remaining summary sheet. The problem is that the once the datasheets are gone the summary sheet is wiped out too. Is there a way to 'disconnect' the summary sheet from the data?
Any input would be much appreciated.
Thanks.
Update 2 Disconnect Recordsets
Hi all,
I have 2 disconnect recordsets and I want to update both of them. So, I write the following codes:
rs1.activeconnection = connectionstring
rs2.activeconnection = connectionstring
rs1.updatebatch
rs2.updatebatch
According to MSDN lib, when assigning activeconnection, a new connection is created for each recordset. So rs1 will have its own connection and rs2 will have its too. Then I have a problem here. How can I rollback rs1.updatebatch when there is error on rs2.updatebatch?
It seems that I cannot use begintrans/committran, since rs1 and rs2 are not using the same connection. So, what can I do?
Much thanks,
Mkjoe
Disconnect From Dial-up Connection
I have a home network with 3 computers that share a dial-up internet connection. Sometimes when I have logged on to the internet from my laptop (connection is through my desktop system) I do not get the icon in the system tray that allows me to disconnect from the internet when I am done. I would like to be able to send a message to the desktop computer to disconnect the dial up connection from my laptop. Is this feasible?
How would I:
1) Send a message from one computer on the network to another?
2) When that message is received, disconnect from the internet?
Thanks,
Randy D.
Disconnect Mapped Drives?
can anyone help me, I've been able to map a drive on my home network, what I'd like to do is disconnect the drive by the click of a command button. I've seen various code on this forum but I can't get any of it to work
Disconnect A Project From Sourcesafe
i have added a project to the source safe , now i don't want to work with source safe ,so i have decided to disconnect and remove the project from source safe. what should i do?
Thanks
Disconnect Network Drive
I am looking for a command line command for disconnecting a network drive. Sort of the antidote of:
net use z: \serverdrive
Get it?
Disconnect The Phone Call
Hi friends,
My Phone book + dialer project is complete.... but i am having some sort of problems..... i am using mscomm control to detect a modem and making a phone call... The code i use to make a call is
VB Code:
On Error GoTo errIf frmmodify.Text1.Text <> "" ThenCommand1.Enabled = Falsefrmmodify.Command7.Enabled = FalseIf frmmodify.MSComm.PortOpen = False Thenfrmmodify.MSComm.PortOpen = TrueEnd Iffrmmodify.MSComm.Output = "ATDT" & frmmodify.Text1.Text & vbCrfrmmodify.Command7.Enabled = Falsefrmmodify.Command8.Enabled = Truefrmmodify.Command9.Enabled = Truefrmmodify.Command8.SetFocusElseerr:Command1.Enabled = TrueMsgBox ("The Home Number is not available or some error occured")End If
and similarly for office and mobile numbers.....
here frmmodify.text1.text is the home number to be dialed....
The code i use to dissconect the phone call is
VB Code:
On Error GoTo err:Command7.Enabled = FalseCommand8.Enabled = FalseCommand9.Enabled = Truefrmmodify.MSComm.PortOpen = FalseCommand8.Enabled = FalseCommand7.Enabled = TrueCommand7.SetFocusFrmdialoption.Command1.Enabled = TrueFrmdialoption.Command2.Enabled = TrueFrmdialoption.Command3.Enabled = Trueerr:
The code works well if the other person has not picked up the phone.... but if other person has picked up the phone,i will not only click the End button,but put the phone reciever also to end a call... and i also cannot dissconnect the phone by putting the phone reciever alone....
Kindly Help
Regards
Mohit
Disconnect A Remote Computer
Anyone knows how i can disconnect a computer connected to the server after a period of time so that once disconnected one cant browse the web?
|