Click here to Skip to main content
15,884,628 members
Articles / High Performance Computing / Parallel Processing

Use of free SocketPro package for creating super client and server applications

Rate me:
Please Sign up or sign in to vote.
4.48/5 (19 votes)
23 Feb 200211 min read 179.3K   6.3K   59  
A set of socket libraries for writing distributed computing applications over the internet
// SBroker.idl : IDL source for SBroker.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (SBroker.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
	[
		object,
		uuid(149960EF-D865-11D5-8AF9-002078B038BB),
		dual,
		helpstring("ISocketBroker Interface"),
		pointer_default(unique)
	]
	interface ISocketBroker : IDispatch
	{
		[id(201), helpstring("method ExecuteCmnd")] HRESULT ExecuteCmnd([in]BSTR strCmnd);
		[id(202), helpstring("method ConnectToDestination")] HRESULT ConnectToDestination([in]BSTR bstrDesAddr, [in]long lDesPort, [in, optional, defaultvalue(1)]long lSocketType, [in, optional, defaultvalue(2)]long lAddrFormat, [in, optional, defaultvalue(0)]long lProtocol);
		[id(203), helpstring("method DisconnectToDestination")] HRESULT DisconnectToDestination();
		[id(204), helpstring("method IsConnectedToDestination")] HRESULT IsConnectedToDestination([out, retval]VARIANT_BOOL *pbIsConnected);
		[id(205), helpstring("method AttachSocket")] HRESULT AttachSocket([in]IUnknown *pIUnknownToSocket);
		[id(206), helpstring("method GetData")] HRESULT GetData([in, optional, defaultvalue(-1)]VARIANT_BOOL bA2W, [out, retval]VARIANT *pvtData);
		[id(207), helpstring("method GetRtn")] HRESULT GetRtn([out, retval]long *plResult);
	};
[
	uuid(149960E1-D865-11D5-8AF9-002078B038BB),
	version(1.0),
	helpstring("SBroker 1.0 Type Library")
]
library SBROKERLib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	typedef enum tagSockBrokerDefines
	{
		g_nBrokerClient =	0xB00000AA,
		idConnectToDes =	(0x01000000+1),
		idDisconnectToDes =	(0x01000000+2),
		idExecuteCommand =	(0x01000000+3),
		idIsConnectedToDes = (0x01000000+4),
	}SockBrokerDefines;

	[
		uuid(149960F1-D865-11D5-8AF9-002078B038BB),
		helpstring("_ISocketBrokerEvents Interface")
	]
	dispinterface _ISocketBrokerEvents
	{
		properties:
		methods:
		[id(1), helpstring("method OnDestinationConnected")] HRESULT OnDestinationConnected([in]long lError);
		[id(2), helpstring("method OnDestinationDisconnected")] HRESULT OnDestinationDisconnected();
	};

	[
		uuid(149960F0-D865-11D5-8AF9-002078B038BB),
		helpstring("SocketBroker Class")
	]
	coclass SocketBroker
	{
		[default] interface ISocketBroker;
		[default, source] dispinterface _ISocketBrokerEvents;
	};
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
Yuancai (Charlie) Ye, an experienced C/C++ software engineer, lives in Atlanta, Georgia. He is an expert at continuous inline request/result batching, real-time stream processing, asynchronous data transferring and parallel computation for the best communication throughput and latency. He has been working at SocketPro (https://github.com/udaparts/socketpro) for more than fifteen years.

Comments and Discussions