Article # 655, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
Closing someone else's sockets (i.e. closing a domain).
Q. Is it possible to close down other people's sockets? I am trying this code but it fails to hangup the phone: MediumAndUnit theMedium; SocketError se; char tcpDomain[] = "TCPIP"; word bufsize = 100; se = SocketCheckMediumConnection( tcpDomain, buffer, &bufsize, &theMedium ); theMedium.MU_medium.MET_id = GMID_CELL_MODEM; theMedium.MU_medium.MET_manuf = MANUFACTURER_ID_GEOWORKS; theMedium.MU_unitType = MUT_ANY; theMedium.MU_unit = 0; se = SocketCloseDomainMedium( tcpDomain, &theMedium, TRUE ); A. Yes, it is possible to shut down the whole PPP Socket system, by passing TRUE as the third parameter to SocketCloseDomainMedium(). In fact, this is exactly what the 'Hang Up' trigger in the main Internet Services view does. You must pass a valid MediumAndUnit structure in order for SocketCloseDomainMedium() to work. You can get this from SocketGetAddressMedium() given the SocketAddress. You can also be kept apprised of socket links that are created by using SysHookNotification() with SST_SOCKET as the first parameter. In the callback routine parameters, word1 will be the MediumUnitType, word2 will be the unit itself (MU_unit), and word3/word4 will be the MediumType.