Консультация № 60633
30.10.2006, 06:58
0.00 руб.
0 5 1
Здравствуйте!
В SocetConnection есть свойство порт, а в DCOMConnection нет такого свойства. Как работать с портами в DCOMConnection?

И ещё один вопрос который почемуто не попал к экспертам.
Что Вы скажите уважаемые эксперты по поводу вот этой статьи:
http://www.delphikingdom.com/asp/viewitem.asp?catalogID=773 ?
Т.е. какие ошибки в этой статье, как можно улучшить проект представленный в данной статье?

Обсуждение

Неизвестный
30.10.2006, 08:15
общий
это ответ
Здравствуйте, KuchumHan!

DComConnection, насколько я понял, полистав хелп делфы, работает через COM + или MTS у которых впринципе являеться частью финды, а по сему я предпологаю, что порт для этих соединений забиндин самой системой !!!

ClientConnection идентифицирует машину по IP, а значит и порт приложения необходим !!! это сделано насколько я понял для поддержи множественных серверов, чтобы менять сервер во время работы.

Пример впринципе простой, и не сложный, и ошибок как бы я не заметил, но для каких-либо крупных задачь может задуматься об использовании SQL (Oracle), тем более, что компанентов для этих целей предостаточно !!!

Приложение:
из хелпа по DCOMDCOM provides the most direct approach to communication, requiring no additional runtime applications on the server. However, because DCOM is not included with Windows 95, some older client machines may not have DCOM installed.DCOM provides the only approach that lets you use security services when writing a transactional data module. These security services are based on assigning roles to the callers of transactional objects. When using DCOM, DCOM identifies the caller to the system that calls your application server (MTS or COM+). Therefore, it is possible to accurately determine the role of the caller. When using other protocols, however, there is a runtime executable, separate from the application server, that receives client calls. This runtime executable makes COM calls into the application server on behalf of the client. Because of this, it is impossible to assign roles to separate clients: The runtime executable is, effectively, the only client. Хелп по connectionYou can establish a connection to the application server using sockets from any machine that has a TCP/IP address. This method has the advantage of being applicable to more machines, but does not provide for using any security protocols. When using sockets, include a TSocketConnection component for connecting to the application server. TSocketConnection identifies the server machine using the IP Address or host name of the server system, and the port number of the socket dispatcher program (Scktsrvr.exe) that is running on the server machine. For more information about IP addresses and port values, see Describing sockets.Three properties of TSocketConnection specify this information:Address specifies the IP Address of the server. Host specifies the host name of the server. Port specifies the port number of the socket dispatcher program on the application server.Address and Host are mutually exclusive. Setting one unsets the value of the other. For information on which one to use, see Describing the host.If you have multiple servers that your client application can choose from, you can use the ObjectBroker property instead of specifying a value for Address or Host. For more information, see Brokering connections. By default, the value of Port is 211, which is the default port number of the socket dispatcher programs supplied with Delphi. If the socket dispatcher has been configured to use a different port, set the Port property to match that value.Note: You can configure the port of the socket dispatcher while it is running by right-clicking the Borland Socket Server tray icon and choosing Properties.Although socket connections do not provide for using security protocols, you can customize the socket connection to add your own encryption. To do this1 Create a COM object that supports the IDataIntercept interface. This is an interface for encrypting and decrypting data.2 Use TPacketInterceptFactory as the class factory for this object. If you are using a wizard to create the COM object in step 1, replace the line in the initialization section that says TComponentFactory.Create(...) with TPacketInterceptFactory.Create(...).3 Register your new COM server on the client machine.4 Set the InterceptName or InterceptGUID property of the socket connection component to specify this COM object. If you used TPacketInterceptFactory in step 2, your COM server appears in the drop-down list of the Object Inspector for the InterceptName property.5 Finally, right click the Borland Socket Server tray icon, choose Properties, and on the properties tab set the Intercept Name or Intercept GUID to the ProgId or GUID for the interceptor. This mechanism can also be used for data compression and decompression.
Неизвестный
30.10.2006, 09:13
общий
За цитирование хелпа конечно спасибо :-)Но вот в чём суть, это приложение работает на одном ПК, а если задействовать это приложение на двух ПК(сервер на одном ПК, а клиент на другом) эта программа не работает. Сервер установлен на ПК с ОС Win2003Server, а клиент на ПК с ОС WinXP.
Неизвестный
30.10.2006, 16:24
общий
Действительно, номер порта для DCOM зафиксирован, посему менять его нельзя.Не работать может много по какой причине. Например, FireWall закрыл доступ.
Неизвестный
31.10.2006, 06:10
общий
а если программы FireWall нет?
Неизвестный
31.10.2006, 17:47
общий
А вы точно уверены, что нет? Ведь есть даже встроенный в Windows брандмауэр. Вы его отключали/настраивали?Статью не читал и запускать у себя не пробовал, так что не знаю, что там еще не работать может. А идей чисто из головы больше никаких нет.
Форма ответа