|
-
Jan 9th, 2003, 05:06 AM
#1
Thread Starter
Member
Sockets, Redirecting ports
Using sockets, if I connect to port 139, how (or is it possible) to redirect data to 135?
"It is preoccupation with possessions, more than anything else, that prevents us from living freely and nobly." -Bertrand Russell
-
Jan 9th, 2003, 05:09 AM
#2
Thread Starter
Member
Nevermind,
I CAN connect to port 135. When I send the data, the Messenger service window is not popping up though.
"It is preoccupation with possessions, more than anything else, that prevents us from living freely and nobly." -Bertrand Russell
-
Jan 9th, 2003, 12:32 PM
#3
Hyperactive Member
It's not that simple, If you want to send messenger messages, you can't just send a packet on port 135/139 and expect it to work. I sniffed those packets and it's a series UDP/TCP/IP packets on multiple sends. Anyways you need to either shell out and use the Net Send command OR do it the preferred way (as I have) and use NetMessageBufferSend API, it works fine in .Net.
-
Jan 9th, 2003, 01:11 PM
#4
Thread Starter
Member
Thanks,
The current way I have been doing it is using the DOS shell. My app uses sockets to ping the user first, then, if the user is pingable, sends the message.
I wanted to have uniformity with the ping and the net send.
I could'nt get the API to work right I was using NetMessageBufferSend from the netapi32.
Could you post your code for the api?
"It is preoccupation with possessions, more than anything else, that prevents us from living freely and nobly." -Bertrand Russell
-
Jan 9th, 2003, 01:18 PM
#5
Hyperactive Member
Private Declare Unicode Function NetMessageBufferSend Lib "NetApi32" (ByVal inServ As String, ByVal inTo As String, ByVal inFrom As String, ByVal inMsg As String, ByVal MsgLen As Int32) As Int32
And to call it....
intRet = NetMessageBufferSend(vbNullString, objIP.ToString, strFrom, strMsg, strMsg.Length * 2)
Hope that helps...
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
|