* from the client i wrote the following to connect to the lightstreamer and send a message
Code:
string pushServerHost = "localhost";
const int pushServerPort = 8080;
string pushServerUrl = "http://" + pushServerHost + ":" + pushServerPort;
ConnectionInfo _cInfo = new ConnectionInfo();
_cInfo.PushServerUrl = pushServerUrl;
_cInfo.Adapter = "PROXY_HELLOWORLD";
LSClient client = new LSClient();
//client.SendMessage("fghgfh");
client.OpenConnection(_cInfo, new ConnectionListener());
client.SendMessage("message");
* the adapter launcher code as following
Code:
DataProviderServer server = new DataProviderServer();
server.Adapter = new HelloWorldAdapter();
TcpClient reqrepSocket = new TcpClient(host, 6661);
server.RequestStream = reqrepSocket.GetStream();
server.ReplyStream = reqrepSocket.GetStream();
TcpClient notif_Socket = new TcpClient(host, 6662);
server.NotifyStream = notif_Socket.GetStream();
server.Start();
* the adapter inherites the class LiteralBasedProvider and i implement all the methods of it as folllow
Code:
public class HelloWorldAdapter :LiteralBasedProvider,IDataProvider
{
private IItemEventListener _listener;
public void Init(IDictionary parameters, string configFile)
{
//throw new NotImplementedException();
}
public bool IsSnapshotAvailable(string itemName)
{
//throw new NotImplementedException();
return false;
}
public void SetListener(IItemEventListener eventListener)
{
//throw new NotImplementedException();
_listener = eventListener;
}
public void Subscribe(string itemName)
{
Class1 obj = new Class1();
obj._listener = _listener;
obj._id = itemName.Replace("item", "");
Thread t = new Thread(new ThreadStart(obj.Run));
t.Start();
}
public void Unsubscribe(string itemName)
{
//throw new NotImplementedException();
}
public override int GetAllowedBufferSize(string user, string item)
{
throw new NotImplementedException();
}
public override double GetAllowedMaxBandwidth(string user)
{
throw new NotImplementedException();
}
public override double GetAllowedMaxItemFrequency(string user, string item)
{
throw new NotImplementedException();
}
public override int GetDistinctSnapshotLength(string item)
{
throw new NotImplementedException();
}
public override string[] GetItems(string user, string sessionID, string group)
{
throw new NotImplementedException();
}
public override double GetMinSourceFrequency(string item)
{
throw new NotImplementedException();
}
public override string[] GetSchema(string user, string sessionID, string id, string schema)
{
throw new NotImplementedException();
}
public override bool IsModeAllowed(string user, string item, Mode mode)
{
throw new NotImplementedException();
}
public override bool ModeMayBeAllowed(string item, Mode mode)
{
throw new NotImplementedException();
}
public override void NotifyNewSession(string user, string sessionID, IDictionary clientContext)
{
throw new NotImplementedException();
}
public override void NotifyNewTables(string user, string sessionID, TableInfo[] tables)
{
throw new NotImplementedException();
}
public override void NotifySessionClose(string sessionID)
{
throw new NotImplementedException();
}
public override void NotifyTablesClose(string sessionID, TableInfo[] tables)
{
throw new NotImplementedException();
}
public override void NotifyUser(string user, string password, IDictionary httpHeaders, string clientPrincipal)
{
throw new NotImplementedException();
}
public override void NotifyUser(string user, string password, IDictionary httpHeaders)
{
throw new NotImplementedException();
}
public void NotifyUserMessage(string user, string sessionID, string message)
{
throw new NotImplementedException();
}
public bool WantsTablesNotification(string user)
{
throw new NotImplementedException();
}
}
after doing that i still have the same exception message "unsupported function" on this line client.SendMessage("message");
Bookmarks