-
Jul 3rd, 2022, 09:14 PM
#1
Thread Starter
Banned
sendbroadcast packets to all interface?
WinIPBroadcast is a small program that allows Windows applications to send global IP broadcast packets (destination address 255.255.255.255) to all interfaces instead of just the preferred one.
this can do it tested it https://github.com/dechamps/WinIPBroadcast
please anyone how do i do this with vb6 maybe winsock chat or multi server winsock or maybe simple project with winsock
https://tangentsoft.net/wskfaq/inter...html#broadcast
Last edited by jenniger9; Jul 3rd, 2022 at 09:22 PM.
-
Jul 3rd, 2022, 11:56 PM
#2
Re: sendbroadcast packets to all interface?
You have the entire C source code showing you how to do it. Just translate it to VB6. The only part you cannot replicate is the plumbing that makes it capable of being a Windows Service but you can work around that.
-
Jul 4th, 2022, 06:52 AM
#3
Thread Starter
Banned
Re: sendbroadcast packets to all interface?
Originally Posted by Niya
You have the entire C source code showing you how to do it. Just translate it to VB6. The only part you cannot replicate is the plumbing that makes it capable of being a Windows Service but you can work around that.
hi niya. i don't know how to translate it this is why i needed help.
-
Jul 4th, 2022, 08:06 AM
#4
Re: sendbroadcast packets to all interface?
This isn't a trivial amount of code. Just the Winsock imports alone is a couple hours work unless someone has already written them out. The rest of it.......just work and not to mention testing to make sure it all works correctly. I'm usually the kind one but I don't have that kind of time right now.
-
Jul 4th, 2022, 04:57 PM
#5
Thread Starter
Banned
Re: sendbroadcast packets to all interface?
if anybody can help with this will be greatfull
-
Jul 5th, 2022, 02:01 PM
#6
Re: sendbroadcast packets to all interface?
Originally Posted by Niya
You have the entire C source code showing you how to do it. Just translate it to VB6. The only part you cannot replicate is the plumbing that makes it capable of being a Windows Service but you can work around that.
Why wouldn't you be able to be a service?
-
Jul 5th, 2022, 03:55 PM
#7
Re: sendbroadcast packets to all interface?
Originally Posted by fafalone
Why wouldn't you be able to be a service?
If the VB6 compiler can export the entry point ServiceMain it might be possible. I don't know if it can.
-
Jul 5th, 2022, 03:58 PM
#8
Re: sendbroadcast packets to all interface?
Originally Posted by Niya
If the VB6 compiler can export the entry point ServiceMain it might be possible. I don't know if it can.
NSSM FTW!
-
Jul 5th, 2022, 05:26 PM
#9
Re: sendbroadcast packets to all interface?
Originally Posted by peterst
I'm aware of this method. I've used SrvAny in the distant past to run VB6 applications as services which is the workaround I alluded to. But the C source that OP posted is an actual Windows Service. I'm not sure translating that part of it to VB6 would work.
-
Jul 5th, 2022, 06:51 PM
#10
Re: sendbroadcast packets to all interface?
Isn't it just passing the address of the functions as callbacks? I don't even see any multithreading with that method, not that it's not fairly easy to do that in VB6 these days... this demo suggests it's easy enough to run a service with VB6 with a separate thread.
Isn't exporting for DLL-based services running under svchost, rather than an exe acting as a service?
-
Jul 5th, 2022, 09:53 PM
#11
Thread Starter
Banned
Re: sendbroadcast packets to all interface?
Originally Posted by fafalone
Isn't it just passing the address of the functions as callbacks? I don't even see any multithreading with that method, not that it's not fairly easy to do that in VB6 these days... this demo suggests it's easy enough to run a service with VB6 with a separate thread.
Isn't exporting for DLL-based services running under svchost, rather than an exe acting as a service?
this tool is command line tool you need to execute app.exe run using windows cmd and it remains still working in background.
what does this do.
main goal is to host server /join multiplayer on lan.
now when i run a multiplayer game on vmware and host a game the main pc running the same game while in multiplayer section you cannot see the hosted game.
running that tool leaving it running then going back in game in main pc in multiplayer section you can see the game hosted by the vmware.
test 2
vmware being client looking for hosted games running this tool and main pc being host,vmware is unable to see the main pc hosted game.
-
Jul 6th, 2022, 03:19 AM
#12
Re: sendbroadcast packets to all interface?
Originally Posted by fafalone
Isn't it just passing the address of the functions as callbacks? I don't even see any multithreading with that method, not that it's not fairly easy to do that in VB6 these days... this demo suggests it's easy enough to run a service with VB6 with a separate thread.
Isn't exporting for DLL-based services running under svchost, rather than an exe acting as a service?
Actually upon more detailed examination of the C code, it might actually be possible to run this as a service in VB6. Look at this:-
Code:
SERVICE_TABLE_ENTRY dispatchTable[] =
{
{ SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION)serviceMain },
{ NULL, NULL }
};
mainThread = NULL;
serviceStatus = NULL;
if (!StartServiceCtrlDispatcher(dispatchTable))
{
if (GetLastError() != ERROR_FAILED_SERVICE_CONTROLLER_CONNECT)
systemError(TEXT("StartServiceCtrlDispatcher"), TRUE);
}
else
return 0;
The above can be found in the standard entry-point into the application. It looks as if the Service Control Manager calls this entry point just like as the OS would call it for a normal EXE only when it's called from the SCM, StartServiceCtrlDispatcher(dispatchTable) would succeed which would then call ServiceMain as a callback which actually starts the service.
So a standard Sub Main() in VB6 could actually work. I don't know though. Even in VB6's hayday, people weren't rushing to write Windows Services in it so I have to believe it's not as easy as it would to do as it would be in C. The SCM may be executing callbacks on different threads and this tends to make VB6 applications misbehave. Also, the Microsoft docs state that Windows Services are actually Console applications and VB6 can't make those by default.
All in all, it's probably better to avoid all this headache and use something like SrvAny to run a VB6 application as a service.
Last edited by Niya; Jul 6th, 2022 at 03:29 AM.
-
Jul 6th, 2022, 11:47 AM
#13
Re: sendbroadcast packets to all interface?
Yeah that's what I was thinking... the C code isn't running multiple threads, and doesn't appear to be a DLL where the function is exported. And callbacks where you pass a function pointer to an API work in most other situations.
The project I linked is a service implemented in VB6 with a separate controller and main service... but it's calling CreateThread so that introduces some limits to what you can do and APIs have to be in a TLB (though using something like The trick's multithreading module should get around that). I haven't tested it though.
All in all, it's probably better to avoid all this headache and use something like SrvAny to run a VB6 application as a service.
Who uses VB6 still and isn't interested in pushing it's boundaries?
-
Jul 6th, 2022, 12:40 PM
#14
Re: sendbroadcast packets to all interface?
It is possible to write the services in VB6. If you need a dll with the callbacks in different threads you can use this module.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|