im having a nightmare of a time trying to get sharp Pcap to send packets happily via multiple instances of ICaptureDevice. The problem is that If i use more than one instance of ICaptureDevice any existing ones will just drop out and no error is thrown.
I was wondering if you have any ideas on how to keep all instances of ICaptureDevice work happily. ( If you have had this issue)
Unfortunately I can not provide code examples as this is Proprietary software im building.
I have tried aggregrating all the packets into one queue stream and getting a single ICapDev to send them but i found this to be too slow for the device recieving them at the other end.
Many thanks for any help
Ok i had a talk with Chris - the use of CaptureDeviceList.New()[i] is advised instead of CaptureDeviceList.Instance[i].
Related
What I'm Trying to Achieve
I'm attempting to build a console game that has multiple console windows that would be displaying inventory, status effects, current map, and health. Another console would be the main one that gathers input to effect the other consoles. The reason I want to do it this way is so that the other consoles can be updating their "graphics" (or text) without disturbing the input flow.
What I've Tried So Far
So far, I've attempted to use System.IO's File, FileStream, StreamWriter, and StreamReader to communicate between the consoles via text files. The problem I've ran into is that, when the main console (the input console) is attempting to write inputs to a file--which is communicating with another console (the "graphics" console)--it throws an error because the "graphical" console is trying to read the input of the file (or vice versa).
I figured that making the FileStream's FileAccess be Readable would do the trick, but I ran into the same issue.
I think I could get this to work if I could communicate between the consoles to tell each other that one is done writing to or reading the file... kind of like a back and forth... "I'm writing to the file... okay, I'm done" "I'm reading the file... okay, I'm done" and the cycle continues...
So, in summary, I suppose, my question is how can I communicate between two consoles using files?
Possible Solutions I could try learning SQL, but I don't know if I'd end up running into the same issue... so, if I must learn SQL for this project, I suppose, that'd be my last option.
Thank you!
IPC (inter process communication) is the keyword you're looking for.
There are multiple ways to do IPC, e.g. shared memory, named pipes or similar. .NET has an IpcChannel which uses TCP or a named pipe if the destination is on the local PC.
I am trying to recreate some features of Spotify in C# using the PostgreSQL database.
The reason is simple, I want to gain more knowledge, and I think this is a good challenge.
But I ran into an obstacle that I've been standing for days. Spotify he doesn't download the music, he does her streaming, plays the music while it's downloaded.
However, I can't do this in C#, I'm using the PostgreSQL database.
I'm well locked in this part, I tried several implementations, but I think I'm not on the right track, and on the internet I imagine I'm looking wrong, otherwise I would have found it.
Do you have any guidance for this streaming process in C#? I've tried to read the large_object bytes from PostgreSQL, but couldn't.
Any suggestions or guides about the process are welcome.
You start by getting the file into the database or its network location into the database, whichever gives you better performance; Then start with creating an implementation of a bytestream. You want to be transmitting raw data to c#.
you then build a real time interpreter that takes in using your file format, one byte at a time, and plays the value associated with that section. does that make sense? this is simple to do with many libraries and the brunt of it is just figuring those out.
You seem like you've PROBABLY got that first part down, and are instead having issues with the database. A lot of things we did at my last company involved saving file network locations and indexing files on disk. You might be able to instead point your streamer to a file locally using a server, and instead transmit data from one point to another in that manner instead.
You seem more than capable of doing this just judging by your speech. I hope this comment was helpful, and if it was not I apologize as well. I would be interested in seeing your finished result.
for clarification here would be that workflow:
request for a song listed in table dbo.Songs
matches that song onto dbo.songlocation
streams from dbo.songlocation.location from the filename dbo.songlocation.songname = dbo.song.name and verified directory returns true
enjoyment of that music
I'm trying to send data from a python script to my c# application using a standard input stream. I also need to eventually send data back from my c# application to the another python script. I first tried to do this with a UDP Connection which works fine for a couple lines, but I have a fair amount of data to send (a few thousand lines) and a requirement for data integrity which UDP cannot provide. I could also write to a file, but that seems very inefficient.
One last restriction is that while my two applications are related I cannot setup a direct connection between them using something like IronPython as they are both spawned separately by a 3rd party application.
This is what I am currently trying, but it is not working. Similar to this question: Passing data between Python and C# without writing a file
p = subprocess.Popen(C_SHARP_EXECUTABLE_FILE_PATH, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
p.communicate(blob)
On my C# side I'm not entirely sure how to read this data, but I've tried using things like a loop around this:
Console.ReadLine()
or getting the standard input and reading from it directly using:
Console.OpenStandardInput();
The current issue is that as soon as I call p.communicate my Python script gets locked and doesn't proceed. If it's waiting for the line to be read, what do I need to do to make it stop waiting? I tried only providing the stdin parameter, but that didn't help.
UPDATE:
let me sum up what i have done so far.
I updated my smartphone to 4.0.4 because of android beam.
The following site allows one to send and receive NDEF Messages:
http://www.grundid.de/nfc/ndef-applet.html
that worked perfectly for me.
After that i was able to write an little app which sends NDEF Tags over an P2P connection.
There is only one topic left: Create a desktop based application to receive the tags.
I implemented the following example from github.com :
https://github.com/grundid/nfctools-examples/blob/master/src/main/java/org/nfctools/examples/llcp/LlcpService.java
that worked also well. But i just dont know what happens behind the example. The example class uses a package (jar) consisting of *.class files. Its the same as using the applett. My aim is to create code by my self. A complete project.
So is there a way, to receive ndef tags (over p2p) in .net? or java? this is what iam looking for.
Next Steps:
i will try to use the Winscard.dll:
http://www.aspfree.com/c/a/.NET/Smart-Cards-in-.NET/
but it seems to be only for SDCards and have nothing to do with NFC.
Have you any suggestions or tips to achieve my gaols? that would be wonderful.
Thank you.
Berry
Did you have a look at this project: http://www.grundid.de/nfc/?
i have check IPv4InterfaceStatistics Class of C# and its seems it display all Information of your Network, from bandwidth download / upload, Packet Sent / Rcvd, and Speed of your LAN,
Upon checking the properties, i have found out that all of the properties are GET only.
Is there a way for us to set / limit the bandwidth of download / upload?
thanks in advance.
PS : I need to create an application that will limit the bandwidth of a PC. Thanks
To do that you will need to create a driver, which is not possible to do in C# (or any other managed language). So at least part of your application will need to be written in C or C++.
Maybe TcpDump
will solve you're issue ,learn how to use it than maybe you can control it from C# as a process ,if Tcpdump can't do that ,that give a try with Wireshark i think Wireshark can be implemented within C#