Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

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

, 23 Feb 2002
A set of socket libraries for writing distributed computing applications over the internet
socketpro.zip
netdemo
ClientComponents
MultiSvsSample
SvrComponents
bin
include
lib
Samples
client
DnsSvs
GetHTML
InternetIO
MultiSvsSample
SpeedTest
res
DResolver
Svr
NormalApp
NTSvs
help
trash
SecureSocket
SafeSocket
DNSResolver.exe
GetHtml.exe
IONet.exe
MultipleSvs.exe
MultiSvs.exe
MultiSvsClient.exe
NetBaseR.dll
SafeSocket.exe
SecureSocket.exe
SpeedTest.exe
ClientSocket.dll
DResolver.dll
SBroker.dll
SockFile.dll
fundamental.gif
patterns.gif
NetBaseR.lib
DNSResolver
DNSResolver.vbp
DNSResolver.vbw
frmDNSResolver.frm
frmDNSResolver.frx
frmChatClient.frm
frmChatClient.frx
GETHTML.vbp
GETHTML.vbw
iIO.frm
IONet
IONet.vbp
IONet.vbw
frmMultiSvs.frm
frmMultiSvs.frx
MultiSvs.vbp
MultiSvs.vbw
SafeSocket.vbp
SafeSocket.vbw
SecureSocket.frm
SpeedTest.ico
SpeedTest.aps
SpeedTest.clw
SpeedTest.dsp
SpeedTest.dsw
dlldata.obj
DNS.rgs
DResolver.aps
DResolver.def
DResolver.dsp
DResolver.dsw
DResolver.opt
DResolver.plg
DResolver.tlb
DResolverps.def
DResolverps.exp
DResolverps.lib
DResolverps.mk
DResolver_i.obj
DResolver_p.obj
MultipleSvs.dsp
MultipleSvs.dsw
MultiSvs.dsp
MultiSvs.dsw
MultiSvs.rgs
MultiSvs.tlb
MultiSvsps.def
MultiSvsps.mk
dlldata.obj
SafeSocket.aps
SafeSocket.dsp
SafeSocket.dsw
SafeSocket.plg
SafeSocket.rgs
SafeSocket.tlb
SafeSocketps.def
SafeSocketps.dll
SafeSocketps.exp
SafeSocketps.lib
SafeSocketps.mk
SafeSocket_i.obj
SafeSocket_p.obj
SPassword.rgs
MultipleSvs.exe
MultiSvs.exe
NetBaseR.dll
SafeSocket.exe
// SockFile.idl : IDL source for SockFile.dll
//

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

import "oaidl.idl";
import "ocidl.idl";

	[
		object,
		uuid(41039CFD-ADBC-11D5-8A73-002078B038BB),
		dual,
		helpstring("ISocketFile Interface"),
		pointer_default(unique)
	]
	interface ISocketFile : IDispatch
	{
		[id(131), helpstring("method CloseFile")] HRESULT CloseFile();
		[id(132), helpstring("method FindClose")] HRESULT FindClose();
		[id(133), helpstring("method GetFileAttributes")] HRESULT GetFileAttributes([out, retval] long *plFileAttributes);
		[id(134), helpstring("method SetFileAttributes")] HRESULT SetFileAttributes([in] BSTR bstrFileName, [in]long lFileAttributes);
		[id(135), helpstring("method GetFileSize")] HRESULT GetFileSize([out, optional, defaultvalue(0)] long *plFileSizeHigh, [out, retval] long *plFileSizeLow);
		[id(136), helpstring("method DeleteFile")] HRESULT DeleteFile([in]BSTR bstrFileName);
		[id(137), helpstring("method CreateDirectory")] HRESULT CreateDirectory([in]BSTR bstrDirectory);
		[id(138), helpstring("method RemoveDirectory")] HRESULT RemoveDirectory([in]BSTR bstrDirectory);
		[id(139), helpstring("method GetCurrentDirectory")] HRESULT GetCurrentDirectory();
		[id(140), helpstring("method FindFile")] HRESULT FindFile([in]BSTR bstrFileName);
		[id(141), helpstring("method FindFirstFile")] HRESULT FindFirstFile([in]BSTR bstrFileName);
		[id(142), helpstring("method FindNextFile")] HRESULT FindNextFile();
		[id(143), helpstring("method CreateFile")] HRESULT CreateFile([in]BSTR bstrFileName, [in]long lDesiredAccess, [in]long lShareMode, [in]long lCreationDisposition, [in]long lFlagsAndAttributes);
		[id(144), helpstring("method WriteChunk")] HRESULT WriteChunk([in] VARIANT vtData);
		[id(145), helpstring("method ReadChunk")] HRESULT ReadChunk([in]long lLen);
		[id(146), helpstring("method MoveFile")] HRESULT MoveFile([in]BSTR bstrExistingFileName, [in]BSTR bstrNewFileName);
		[id(147), helpstring("method CopyFile")] HRESULT CopyFile([in]BSTR bstrExistingFileName, [in]BSTR bstrNewFileName, [in, optional, defaultvalue(-1)]VARIANT_BOOL bFailIfExists);
		[id(148), helpstring("method GetFile")] HRESULT GetFile([in]BSTR bstrSrcFileName, [in]BSTR bstrDesFileName, [in, optional, defaultvalue(-1)]VARIANT_BOOL bFailIfExists);
		[id(149), helpstring("method SendFile")] HRESULT SendFile([in]BSTR bstrSrcFileName, [in]BSTR bstrDesFileName, [in, optional, defaultvalue(-1)]VARIANT_BOOL bFailIfExists);
		[id(150), helpstring("method GetCreationTime")] HRESULT GetCreationTime([out]short *pnYear, [out]short *pnMonth, [out]short *pnDayOfWeek, [out]short *pnDay, [out]short *pnHour, [out]short *pnMinute, [out]short *pnSecond, [out]short *pnMilliseconds);
		[id(151), helpstring("method GetLastAccessTime")] HRESULT GetLastAccessTime([out]short *pnYear, [out]short *pnMonth, [out]short *pnDayOfWeek, [out]short *pnDay, [out]short *pnHour, [out]short *pnMinute, [out]short *pnSecond, [out]short *pnMilliseconds);
		[id(152), helpstring("method GetLastWriteTime")] HRESULT GetLastWriteTime([out]short *pnYear, [out]short *pnMonth, [out]short *pnDayOfWeek, [out]short *pnDay, [out]short *pnHour, [out]short *pnMinute, [out]short *pnSecond, [out]short *pnMilliseconds);
		[id(153), helpstring("method SetFilePointer")] HRESULT SetFilePointer([in]long lDistanceToMove, [in]long lMoveMethod);
		[id(154), helpstring("method GetData")] HRESULT GetData([in, optional, defaultvalue(0)]VARIANT_BOOL bA2W, [out, retval]VARIANT *pvtData);
		[id(155), helpstring("method GetRtn")] HRESULT GetRtn([out, retval]long *plResult);
		[id(156), helpstring("method GetFileNameOrDirectory")] HRESULT GetFileNameOrDirectory([out, retval]BSTR *pbstrFileNameOrDirectory);
		[id(157), helpstring("method SetCurrentDirectory")] HRESULT SetCurrentDirectory([in]BSTR bstrCurrentDirectory);
		[id(158), helpstring("method FlushFileBuffers")] HRESULT FlushFileBuffers();
		[id(159), helpstring("method GetSpaceData")] HRESULT GetSpaceData([out]long *plFreeBytesAvailableToCallerLowPart, [out, optional, defaultvalue(0)]long *plTotalNumberOfBytesLowPart, [out, optional, defaultvalue(0)]long *plTotalNumberOfFreeBytesLowPart, [out, optional, defaultvalue(0)]long *plFreeBytesAvailableToCallerHighPart, [out, optional, defaultvalue(0)]long *plTotalNumberOfBytesHighPart, [out, optional, defaultvalue(0)]long *plTotalNumberOfFreeBytesHighPart);
		[id(160), helpstring("method AttachSocket")] HRESULT AttachSocket([in]IUnknown *pIUnknownToSocket);
		[id(161), helpstring("method GetDiskFreeSpaceEx")] HRESULT GetDiskFreeSpaceEx([in]BSTR bstrDirectoryName);
		[id(162), helpstring("method WriteText")] HRESULT WriteText([in]BSTR bstrText, [in, optional, defaultvalue(-1)]VARIANT_BOOL bW2A);
		[propput, id(163), helpstring("property FileKey")] HRESULT FileKey([in] BSTR newVal);
	};

[
	uuid(41039CF1-ADBC-11D5-8A73-002078B038BB),
	version(1.0),
	helpstring("SockFile 1.0 Type Library")
]
library SOCKFILELib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	typedef enum tagSockFileDefines
	{
		g_nCREATE_FILE_SOCK_CLIENT=0xA00000FE,
		g_nFILE_SECURITY_CHECK_FALIED=0x89000000,
	}SockFileDefines;

	typedef enum tagThreadEvent
	{
		ThreadStarted=0x782,
		ThreadProcessing=0x783,
		ThreadEnded=0x784,
	}ThreadEvent;

	typedef enum tagFileMethodID
	{
		idCreateFile =			1,
		idReadFile=				2,
		idWriteFile	=			3,
		idDeleteFile =			4,
		idCopyFile	=			5,
		idMoveFile	=			6,
		idFindFile	=			7,
		idFindFirstFile =		8,
		idFindNextFile =		9,
		idCreateDirectory=		10,
		idGetCurrentDirectory=	11,
		idSetFileAttributes=	12,
		idRemoveDirectory=		13,
		idFindClose=			14,
		idFlushFileBuffers=		15,
		idGetFile=				16,
		idSendFile=				17,
		idSetCurrentDirectory=	18,
		idCloseFile	=			19,
		idSetFilePointer=		20,
		idGetDiskFreeSpaceEx=	21
	}FileMethodID;

	[
		uuid(728360BE-AE26-11D5-8C74-002078B038AB),
		helpstring("_ISktClientEvents Interface")
	]
	dispinterface _ISocketFileEvents
	{
		properties:
		methods:
		[id(1), helpstring("method OnThreadStarted")] HRESULT OnThreadStarted([in]long lDirection, [in]long lInfo);
		[id(2), helpstring("method OnThreadProcessing")] HRESULT OnThreadProcessing([in]long lDirection, [in]long lInfo);
		[id(3), helpstring("method OnThreadDead")] HRESULT OnThreadDead([in]long lDirection, [in]long lInfo);
	};

	[
		uuid(41039CFE-ADBC-11D5-8A73-002078B038BB),
		helpstring("SocketFile Class")
	]
	coclass SocketFile
	{
		[default] interface ISocketFile;
		[default, source] dispinterface _ISocketFileEvents;
	};
};

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

About the Author

Yuancai (Charlie) Ye
Web Developer
United States United States
Yuancai (Charlie) Ye, an experienced software engineer, lives in Atlanta, Georgia. He is an expert at OLEDB consumer and created a powerful data accessing libarary at the site http://www.udaparts.com. He has been working at SocketPro written from batching, asynchrony and parallel computation for more than three years. Visual C++, C# and ASP.NET are his favorite development environments.

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 24 Feb 2002
Article Copyright 2002 by Yuancai (Charlie) Ye
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid