[Question] Winsock? |
Author: |
Message: |
tryxter
Junior Member
A. Maia Ferreira @ PTnet
Posts: 51 Reputation: 1
35 / / –
Joined: Jan 2007
|
O.P. [Question] Winsock?
Hi everyone.
Great forum here! I'm starting my first plugin now. I've got some programming experience.
Already searched the forums, and found something about the winsock problem (only packed with visual studios, and can't be used due to license etc). My question is: there's anything similar to winsock that we can use?
Thanks a lot!
(sorry my english mistakes, i'm Portuguese )
André Ferreira
|
|
01-07-2007 09:44 PM |
|
|
deAd
Scripting Contest Winner
Posts: 1060 Reputation: 28
– / /
Joined: Jan 2006
|
RE: [Question] Winsock?
Depending on what you need you can use an XML HTTP request, but it's probably not suitable for what you're looking for (quite different from winsock ).
You can also try to write a DLL/ActiveX object that allows you to do what you need.
|
|
01-08-2007 12:15 AM |
|
|
ShawnZ
Veteran Member
Posts: 3146 Reputation: 43
32 / /
Joined: Jan 2003
|
RE: [Question] Winsock?
winsock comes with windows...
Spoiler: the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
|
|
01-08-2007 12:31 AM |
|
|
deAd
Scripting Contest Winner
Posts: 1060 Reputation: 28
– / /
Joined: Jan 2006
|
RE: [Question] Winsock?
You can't use it in a script without having Visual Studio installed, and it violates some microsoft terms to use it
|
|
01-08-2007 12:34 AM |
|
|
ShawnZ
Veteran Member
Posts: 3146 Reputation: 43
32 / /
Joined: Jan 2003
|
RE: [Question] Winsock?
quote: Originally posted by deAd
You can't use it in a script without having Visual Studio installed, and it violates some microsoft terms to use it
what microsoft terms
Spoiler: the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
|
|
01-08-2007 12:36 AM |
|
|
Adeptus
Senior Member
Posts: 732 Reputation: 40
Joined: Oct 2005
|
RE: [Question] Winsock?
tryxter,
It might help if you explain what you want to do. Perhaps then someone will have an idea what you can use for it.
Winsock is an API and, as shawnz correctly points out, it's part of Windows. Winsock is not what you need; perhaps something having to do with Winsock is, but that is unclear.
|
|
01-08-2007 12:47 AM |
|
|
deAd
Scripting Contest Winner
Posts: 1060 Reputation: 28
– / /
Joined: Jan 2006
|
RE: RE: [Question] Winsock?
quote: Originally posted by ShawnZ
quote: Originally posted by deAd
You can't use it in a script without having Visual Studio installed, and it violates some microsoft terms to use it
what microsoft terms
http://shoutbox.menthix.net/showthread.php?tid=60242 Read that whole thread, there's stuff in there.
And it does come with windows, but I don't think a usable Active X control does...
This post was edited on 01-08-2007 at 01:10 AM by deAd.
|
|
01-08-2007 01:10 AM |
|
|
tryxter
Junior Member
A. Maia Ferreira @ PTnet
Posts: 51 Reputation: 1
35 / / –
Joined: Jan 2007
|
O.P. RE: [Question] Winsock?
Sorry for not giving too many details.
The objective is create a listen server and a client. I'll be the server and another contact will be the client (that can be switched, of course).
Sometime ago, I've done something similar using VB and Winsock, that's why I asked for winsock...
Thanks a lot for all your answers!
This post was edited on 01-08-2007 at 10:04 AM by tryxter.
|
|
01-08-2007 10:03 AM |
|
|
Deco
Full Member
Posts: 188 Reputation: 4
42 / /
Joined: Aug 2006
|
RE: [Question] Winsock?
Hey Tryxter..
Here's the code for a dll I made. It looks silly because I'm sending a message to myself.. but I use it to trick another program.
code: using System;
using System.Collections;
using System.Text;
using System.Runtime.InteropServices;
using System.Net;
using System.Net.Sockets;
namespace CS
{
[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _Functions
{
[DispId(1)]
string SendPacket(string msg, int port);
}
[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("MPL.Functions")]
public class Functions : _Functions
{
public string SendPacket(string msg, int port)
{
byte[] sendBytes = Encoding.ASCII.GetBytes(msg);
UdpClient myClient = new UdpClient();
myClient.Send(sendBytes, sendBytes.Length, Dns.GetHostName(), port);
return "ok";
}
}
}
And then this is how to use it in the script.
code: function OnEvent_Initialize(MessengerStart)
{
var obj = new ActiveXObject("MPL.Functions");
var msg = obj.SendPacket("teste",11000);
}
Oh and the dll isn''t originally mine.. someone sent it sorry I don't rememer who :/
HAve fun!
|
|
01-08-2007 04:43 PM |
|
|
tryxter
Junior Member
A. Maia Ferreira @ PTnet
Posts: 51 Reputation: 1
35 / / –
Joined: Jan 2007
|
O.P. RE: [Question] Winsock?
quote: Originally posted by Deco
code: function OnEvent_Initialize(MessengerStart)
{
var obj = new ActiveXObject("MPL.Functions");
var msg = obj.SendPacket("teste",11000);
}
I can't use it to send data to other computers, do I?
"teste" is the string sent by the function and 11000 the port that is used right?
Thanks a lot Deco. (Obrigado será o mais razoável não? )
|
|
01-08-2007 06:51 PM |
|
|
|