|
I am a big fan of curl for testing WCF/REST services. Fiddler is also really, really good.
|
# ¿ Dec 4, 2012 16:50 |
|
|
# ¿ May 22, 2024 14:10 |
|
Anyone here familiar with RX? I would like to ask some questions about it cause my understanding of it is severely lacking and documentation that I understand is hard to come by.
|
# ¿ Jan 6, 2013 23:19 |
|
Nice, I am having a hard time finding resources on the net about the latest version of RX. An example being that FromAsyncPattern is deprecated and is now superseded by FromAsync. This is fine except a lot of blogs and examples still use the FromAsyncPattern. So any pointers to resources that are up to date would be awesome. I am at work now, when I get home I will try to make a better post.
|
# ¿ Jan 7, 2013 09:51 |
|
So I am writing a little server using HttpListener and it is working as it should. Now I want to receive files and I can't figure out how to go about this. HttpListener only exposes a requestbody stream and so I get only the raw stream to work with. A POST includes a lot of extra information including a boundary between files. Is there a way in the .Net framework where I can pass this stream into that does all this for me? Pass the stream into a HttpContent class or something. Or am I going to be stripping the stream and extracting the data body manually?
|
# ¿ Feb 19, 2013 14:47 |
|
hewerman posted:If you are writing this from scratch using HttpListener, I believe you're going to have to use the POST and the boundaries and pass them to some sort of StreamReader or FileStream. My only actual experience is with MVC, where it is much more convenient to get the list of files. I was afraid of that, too bad you can't just pass an inputstream to some other base class and let it do the heavy lifting. HttpRequest.Files looked like a good candidate. Seeing as this is for my own project I might even just pass the file directly into the inputstream and copying it 1 to 1 to a file. I can get the filename from the URL it is posted to.
|
# ¿ Feb 19, 2013 21:03 |
|
wwb posted:IIRC you can self-host the new WebAPI stuff which might be exactly what you all are looking for here. The WebAPI is also open source so perhaps you can find the magics to do it yourself in their codes. I don't know, I think WebApi needs a lot of extra "stuff" to get working, at least that is the general idea that I got from it. HTTP listener just needs HTTP.SYS and works pretty good on Mono. I've looked at the NancyFX source and finally figured out how they extract the Byte stream from the Request.Inputstream. Now to code it up for myself. At my level of coding this is pretty advanced stuff. As for the stream: I figured I would filestream it to disk if over a certain size, this is what Nancy also does. Which made a me feel a little better because I thought of that before I saw it in their source. The filestream would result in a seekable stream so I can extract the bytestream that contains the data from the inputstream. If it works like I hope it does it should keep memory usage down and perform pretty well. My experience with streams and the performance of them is limited to be honest. Any pointers or do's and don'ts are welcome Mr Shiny Pants fucked around with this message at 00:28 on Feb 22, 2013 |
# ¿ Feb 22, 2013 00:24 |
|
wwb posted:Interesting, wasn't aware of the mono angle. One thing you might look at then would be manos de mono (http://manosdemono.org/) I've taken a look at Manos, it looks pretty good as a non blocking webserver. Another one is Kayak if I am not mistaken. The idea is to get this running through Mono on a Raspberry Pi. Thanks for the tip.
|
# ¿ Feb 22, 2013 12:18 |
|
Thanks One of the biggest problems I found when programming, and I am pretty new to all of this, is not getting demotivated if things don't work. So far, one of my biggest accomplishments is still working on the project.
|
# ¿ Feb 22, 2013 14:43 |
|
Well I've got my multipart stream decoding piece working, yay! Streams are pretty nice Just remember to set the right position otherwise you'll be scratching your head figuring out why I doesn't work.... One nice thing about building it myself is that my understanding of what is happening has been greatly enhanced. This has lead to the removal of some code that was unnecessary making it all a bit simpler.
|
# ¿ Mar 2, 2013 00:02 |
|
Another vote for Plink, my friend uses it to automate his VMware backups on his home network. It's pretty powerful.
|
# ¿ Mar 9, 2013 10:12 |
|
zokie posted:I'm having issues with ASP.NET MVC, when deployed to our ISS any first visit to the website is soo sloooow. Does anyone have the same experience and any idea of how to fix it? It has to spin up everything so that takes awhile. For sharepoint there are warmup scripts that do this for you. A batch file doing a http request to your site should be sufficient to get everything "warmed-up" making request handling smoother for the first user. IIS 7.5 contains logic to keep an application pool "warm" if I am not mistaken.
|
# ¿ Mar 26, 2013 12:38 |
|
Dietrich posted:I wrote a windows service named SiteWarmer that issues requests to our various sites on a regular basis to keep them hot, all configurable from the app.config. It was a nice couple hour project. Cool, I wrote a little app that queries our SharePoint farm for all sites and subsites and queries them. I'll check your tool also, might come in handy for other things.
|
# ¿ Mar 27, 2013 21:32 |
|
I have a bit of a conceptual question regarding static classes vs regular ones and when to use them. I have a small webserver that handles requests, these requests can contain files and need to be persisted to disk. The logic for writing these streams is now handled by a static class so I don't have to keep a reference to the class in the HTTP handler logic. I just do Datastore.persistfile(file) or whatever and it works. Now I was wondering if I am going about this in the right way or that this is going to bite me down the road with threading or something. I can't oversee any holes I am digging for myself so to speak. Any pointers or guidelines for this? A lot of stuff I've read over at stack overflow deals with singletons and whatnot but it is not really clear to me. Now my own logic is that I don't need an instance of this class. I only need the one datastore for writing to disk, that's also a reason I made it static. Thinking about this further and the reason for posting this question is that I have another problem with references to other classes. So I've been reading about dependency injection and inversion of control but this too advanced right now for me. Conceptually I am thinking about it like this: A request comes in, gets instantiated into the proper request object, during this I inject a Datastore instance and any other class instances I might need to handle the request. Afterwards I dispose the lot. Sounds ok? Mr Shiny Pants fucked around with this message at 21:59 on Mar 27, 2013 |
# ¿ Mar 27, 2013 21:48 |
|
Stubb Dogg posted:I would use two lists is in most cases, but you probably should look into something like Reactive Extensions (Rx) because I think it is good fit for what you're trying to do. Or you could use the new async/await methods, take the request and handle it using a task.
|
# ¿ Mar 28, 2013 19:51 |
|
Try running VS as administrator. Might be UAC tripping you up.
|
# ¿ Mar 29, 2013 20:00 |
|
wwb posted:Why would UAC kick in for a remote network share? Well I had problems with saving to my own UNC share because of it. Something about credentials not being shared between processes I guess. Another thing that might bite you is that you are saving to an IP address and Windows treating it as a internet address. I had this problem with a VS extension that would not load. After copying it from my DFS redirected home directory it worked like a charm. My DFS directory was configured as a FQDN. Putting the ip or FQDN in your intranet zone in IE likely fixes this. Mr Shiny Pants fucked around with this message at 00:34 on Mar 30, 2013 |
# ¿ Mar 30, 2013 00:11 |
|
fankey posted:Any suggestions for a .NET embedded web server? I'd prefer something that doesn't use HttpListener (http.sys) but handles the TCP/IP transfers natively because the server needs to use ephemeral ports which I don't think would be easy to do with a http.sys solution. http.sys also seems to either require running as Administrator or using netsh to configure it. All I need to do is serve up files and support basic auth on some of the files. I have my own hacked together HTTP server but it's unreliable with certain clients ( which doesn't surprise me ) and I figure it would take less time to integrate a well tested HTTP server than futz around with mine. You can use the Mono one. It is HTTP listener but does not need to be run as administrator IIRC.
|
# ¿ Nov 6, 2013 12:54 |
|
Anyone have any experience with UPNP in .Net? I want my program to open a port on a router so that it can accept incoming traffic on a random port. I've looked for a good library and found Mono.nat. After turning on Upnp on my router it finds it but I can't get my external ip. I've turned off the Windows firewall and during debugging I can see it communicating with the router but i have no clue how to interpret the returned data. Everything looks ok.
|
# ¿ Jan 23, 2014 21:52 |
|
Thanks, i'll take a look. Would this code by any chance also work on Mono? I need to run this on Linux also Edit: drat, that looks complicated..... I have a bit of a dilemma, one the one hand it would be awesome that it would autoconfigure, on the other hand there are some completely broken UPNP servers making the event of it working as it should a bit of a crapshoot. Maybe some old fashioned port forwarding would be enough. Mr Shiny Pants fucked around with this message at 22:40 on Jan 23, 2014 |
# ¿ Jan 23, 2014 22:34 |
|
I would put it in something like an Item factory. When a new item is created the factory is responsible for setting the right SKU number.
|
# ¿ Jan 24, 2014 09:49 |
|
ninjeff posted:Forgive me if I'm wrong, but this seems like what you actually want. The calculation should be different for different data stores, so that it doesn't take forever to run. Even in Mr Shiny Pants'/Dietrich's solution, you still need to write the IItemRepository query that the ItemFactory calls. That also sounds plausible, if the SKU number is something that is dependent on the type of repository and not just a number for tracking/identification. Mr Shiny Pants fucked around with this message at 17:52 on Jan 24, 2014 |
# ¿ Jan 24, 2014 17:46 |
|
Night Shade posted:Are any of you guys using Service Bus for Windows Server? Any ideas how to get a service running as SYSTEM to authenticate against it? If it is over the network it won't work, system is for the local machine. Configure your app to talk with the servicebus using a domain account. configure the service to run as a user instead of localsystem.
|
# ¿ Feb 6, 2014 10:00 |
|
wwb posted:^^^ if you don't have a domain handy then you can also use 2 similarly named / passworded windows accounts. Yes, i forgot to mention this also works.
|
# ¿ Feb 6, 2014 19:33 |
|
For anyone struggling with IOC and DI ( like me ). This is the best explanation I have found: https://www.youtube.com/watch?v=5lIeky2V4dc It's pretty long but goes in great detail about WHY you want it.
|
# ¿ Feb 6, 2014 21:22 |
|
ljw1004 posted:Gosh, I've not used IOC/DI myself, and after that video I strongly don't want to. I found it helpful in that he created a narrative that explained why he was doing things. Even in simple programs you stumble on the classes depending on classes etc. etc. I quite like it, to each his own I guess but for making core concepts clear i thought it was pretty good. Especially writing his own container and showing how IOC containers map constructors and how something "could" work was pretty nice. Now I must be honest, it feels all a little cargo culty which seems to crop up a lot in IT actually. I mean it always something that is in vogue, IoC, Factory methods, fluent etc. etc. but i quite like this. I can see where you're coming from. Mr Shiny Pants fucked around with this message at 09:29 on Feb 7, 2014 |
# ¿ Feb 7, 2014 09:24 |
|
wwb posted:We've got a little project that involves reading a bunch of PDFs and making them searchable. We can handle the whole "take bags of text and make it searchable" pretty easily but we are having some trouble with the reading PDFs end of the equation. Well for making PDFs searchable Abby Finereader OCR is the best. For free: maybe the Adobe Ifilters for PDF?
|
# ¿ Feb 23, 2014 10:11 |
|
peepsalot posted:Can it work in vista though? The signalr documentation omitted it from its list of supported server platforms, or is that only assuming you are going through IIS or whatever .NET web apps typically use. HttpListener would do the trick in combination with Nancy. It uses http.sys and is supported from XP to 8.1. If you don't want to run the application as administrator, which you must if you use httplistener otherwise it can't open up a port. You can use the Mono one. There is a nuget package for it.
|
# ¿ Apr 18, 2014 09:23 |
|
Ender.uNF posted:I've always regretted using WCF. So what do you recommend? Serious question Webapi? WCF always struck me as being too complex with the whole XML service configuration crap.
|
# ¿ Apr 22, 2014 06:59 |
|
Anyone else ever have a "How deep does the rabbit hole go?" type of thing? Let me expand a bit: I am working on a small application that hosts a webserver, the webserver is based on HTTP listener and after a lot of work I got it working how I want it. The webserver is used for communicating between applications using JSON and acts as a GUI for the user. The JSON is serialized and deserialized correctly and the pages are being served like they should. I am using basic authentication for every connection and so the password is being sent over the wire in Base64 encoded strings that are pretty easy to decipher if you know what it should look like. So my thinking in the beginning was "great, basic auth is pretty simple and very secure once I wrap the the connection in a TLS connection". Here's where things get interesting real quick. Hurdle one: For certificate creation I use the BouncyCastle libraries and they are awesome, they really are. One problem is that you need to find some good tutorials that guide you in how to use them. No problem, Google turned up some awesome blog posts and of we go. After figuring out how they work I can generate self signed certs and they are written to a directory: the private key in PFX file and the public one in the CER file. Great! Hurdle two: If you want to use certificates on HTTP.sys in windows you need to register them using netsh. That sucks, I don't want my application to need to run an external command to set the certificate on the port. Another problem: HTTP listener needs the private key file in a PVK format, which is some Microsoft proprietary crappy private key container format. Bummer. I found some posts on the internet about pvk2pfx that will convert the PFX file to PVK file and that should work. More dependencies on external tools. Crap. Hurdle three: After this I decided to take a look at other options. Lo and behold some nice french guy has ported the Mono HTTP listener to .Net that should be compatible to the one I am using ( I tested my app on Linux, it works ). Downloaded the source code, crap! It needs certmgr or httpcfg or something to load the certificate from a specified directory in the AppData directory. There goes a nice centralized directory holding all the certificates. At this point I was getting pretty annoyed. Someone on stackoverflow pointed out that the listener expects the certs in a specific format in a specific location and it will just load the certs without the need for certmgr or httpcfg. Good! Wrong. It also needs the PVK format. After reading the listener source code I found out that the Mono people have written a class that converts the PVK file to a AsymmetricAlgorithm .Net base class. So, I ripped out the certificate loading code from the mono listener and in two lines load my private key from a PFX: code:
So after three days of pulling my hair out I now have a application that will create it's own CA cert, issue an SSL cert, pass it on to the HTTP listener that will listen on 443 using my just created certificate. Without needing conversion utilities or some other netsh commands. It looked so easy........ Mr Shiny Pants fucked around with this message at 19:49 on Apr 22, 2014 |
# ¿ Apr 22, 2014 19:45 |
|
Working with cetificates is a PITA. No wonder computer security is in shambles, it feels like an overly complicated and over engineered mess.
|
# ¿ Apr 27, 2014 09:55 |
|
GrumpyDoctor posted:Has anyone gotten Git Extensions to work with VS 2013? I want more features than the built-in git provider has, but my problem is that the Git Extensions installer puts its plugin onto a network drive (because that's where my user profile lives), which breaks Git Extensions. The workaround is to make a local copy of the plug-in, but I don't know how to get VS to see it. It can see the add-in fine, but there's no entry in the source control provider drop-down. I think you need to make VS2013 aware of the plugin folder. I had the same problem with my user account being redirected to network drive. You can add a location to VS2013 where it will look for loading plugins. At least, that's how i remember getting it working. YMMV ofcourse.
|
# ¿ May 10, 2014 13:41 |
|
Unity3d is pretty cool. It uses C# as a language.
|
# ¿ May 25, 2014 09:41 |
|
|
# ¿ May 22, 2024 14:10 |
|
Hi, I am working on a FUSE like system that mimics a drive in Windows using the Dokan library. See: http://dokan-dev.net/en/ for details. Now I've got a rudimentary system running using just a folder on my machine that functions as the basis for the drive. If you run the program you get "T:\" drive that looks like regular harddrive but is in effect a directory on disk. The one thing I am running into is the order of operations that Windows expect when dealing with file operations. Example: When deleting a file you go into the DeleteFile method of Dokan but instead of deleting it right away you set the flag "DeleteOnClose" to true. In the "CleanUp" method you do the actual deletion of the file or directory. This tripped me up. Is there any documentation about this? Something that details the steps that Windows expects when doing these operations? I've looked but I can't really find something useful. Let's say you rename a directory: What are the steps I need to do to handle this the right way? Do I create a new directory with the new name? Copy over the files and then delete the original directory?
|
# ¿ Jun 20, 2014 09:21 |