Daily Archives

Articles indexed Wednesday May 26 2010

Page 14/118 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Telnet connection using c#

    - by alejandrobog
    Our office currently uses telnet to query an external server. The procedure is something like this. Connect - telnet opent 128........ 25000 Query - we paste the query and then hit alt + 019 Response - We receive the response as text in the telnet window So I’m trying to make this queries automatic using a c# app. My code is the following First the connection. (No exceptions) SocketClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); String szIPSelected = txtIPAddress.Text; String szPort = txtPort.Text; int alPort = System.Convert.ToInt16(szPort, 10); System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse(szIPSelected); System.Net.IPEndPoint remoteEndPoint = new System.Net.IPEndPoint(remoteIPAddress, alPort); SocketClient.Connect(remoteEndPoint); Then I send the query (No exceptions) string data ="some query"; byte[] byData = System.Text.Encoding.ASCII.GetBytes(data); SocketClient.Send(byData); Then I try to receive the response byte[] buffer = new byte[10]; Receive(SocketClient, buffer, 0, buffer.Length, 10000); string str = Encoding.ASCII.GetString(buffer, 0, buffer.Length); txtDataRx.Text = str; public static void Receive(Socket socket, byte[] buffer, int offset, int size, int timeout) { int startTickCount = Environment.TickCount; int received = 0; // how many bytes is already received do { if (Environment.TickCount > startTickCount + timeout) throw new Exception("Timeout."); try { received += socket.Receive(buffer, offset + received, size - received, SocketFlags.None); } catch (SocketException ex) { if (ex.SocketErrorCode == SocketError.WouldBlock || ex.SocketErrorCode == SocketError.IOPending || ex.SocketErrorCode == SocketError.NoBufferSpaceAvailable) { // socket buffer is probably empty, wait and try again Thread.Sleep(30); } else throw ex; // any serious error occurr } } while (received < size); } Every time I try to receive the response I get "an exsiting connetion has forcibly closed by the remote host" if open telnet and send the same query I get a response right away Any ideas, or suggestions?

    Read the article

  • tapestry5 page to render plain text

    - by pstanton
    Hi All, I've been looking but can't find the the documentation: Is there a way to have a page render a response without the wrapping HTML elements and just print whatever is provided in the body of the tml or alternatively whatever is set in MarkupWriter.write during @BeginRender? I need a page that does some server side processing and returns pure javascript for an external application to request. If that is impossible, is it possible to expose the tapestry Ioc to a servlet in the same app? Thanks, p.

    Read the article

  • Java NIO (Netty): How does Encryption or GZIPping work in theory (with filters)

    - by Tom
    Hello Experts, i would be very thankfull if you can explain to me, how in theory the "Interceptor/Filter" Pattern in ByteStreams (over Sockets/Channels) work (in Asynchronous IO with netty) in regard to encryption or compression of data. Given I have a Filter that does GZIPPING. How is this internally implemented? Does the Filter "collect" so many bytes form the channel, that this is a usefull number of bytes that can then be en/decoded? What is in general the minimal "blocksize(data to encode/decode in a chunk)" of socket based gzipping? Does this "blocksize" have to be negotiated in advance between server and client? What happens if the client does not send enough data to "fill" the blocksize (due to a network conquestion) but does not close the connection. Does this mean the other side will simply wait until it gets enough bytes to decode or until a timeout occoures...How is the Filter pattern the applied? The compression filter will de/compress the blocksize of bytes and then store them again in the same buffer would (in the case of netty) i normally be using the ChannelHanlderContext to pass the de/encoded data to the next filter?... Any explanations/links/tutorials (for beginners;-) will be very much appreciated to help me understand how for example encryption/compressing are implemented in socket based communication with filters/interceptor pattern. thank you very much tom

    Read the article

  • SQL Server transaction log backups,

    - by krimerd
    Hi there, I have a question regarding the transaction log backups in sql server 2008. I am currently taking full backups once a week (Sunday) and transaction log backups daily. I put full backup in folder1 on Sunday and then on Monday I also put the 1st transaction log backup in the same folder. On tuesday, before I take the 2nd transaction log backup I move the first transaction log backup from folder1 an put it into folder2 and then I take the 2nd transaction log backup and put it in the folder1. Same thing on Wed, Thurs and so on. Basicaly in folder1 I always have the latest full backup and the latest transaction log backup while the other transaction log backups are in folder2. My questions is, when sql server is about to take, lets say 4th (Thursday) transaction log backup, does it look for the previous transac log backups (1st, 2nd, and 3rd) so that this new backup will only include the transactions from the last backup or it has some other way of knowing whether there are other transac log backups. Basically, I am asking this because all my transaction log backups seem to be about the same size and I thought that their size will depend on the amount of transactions since the last transaction log backup. Can anyone please explain if my assumptions are right? Thanks...

    Read the article

  • SSH not working after Restoring Running-Config to a Replacement Cisco Router

    - by Kyle Brandt
    One of my Cisco routers died over the weekend, Cisco sent the replacement and I restored the the config using copy tftp: running-config. Everything seems to work fine but I can no longer ssh into the router (I can telnet). The connection is refused, so it isn't listening on port 22 it seems like. I had previously backed up the config by just doing ssh router 'show run' > backup_config from my workstation. So: Is there anything wrong with my method of backup vs copy running-config tftp:? I know I haven't given any debug information, but is there something typical I need to do to get ssh working?

    Read the article

  • 3g/4g compatibility

    - by terrani
    Hi, I am looking for buying Ipad wifi + 3g, but I just heard about 4g. 4g is coming to Verzion very soon. If I buy ipad wifi + 3g now, am I going to able to use 4g with it??

    Read the article

  • find command in Linux

    - by Martin
    My goal is to find all pdf files on a remote machine, so I resort to the useful command find. So I type find ~ *.pdf or find ~ "*.pdf" and I get nothing. I do the same on my machine and I get nothing. I do a regular search from the menu on my machine and I find quite a few pdf files. Would somebody please tell me what am I doing wrong?

    Read the article

  • iMac memory limit

    - by Mike
    I have an iMac that was from the first generation of aluminum iMacs. The reported model is "iMac 7,1". This iMac's manual says I can put 2 2GB modules, but when this manual was made we don't have modules with more than 2GB and also we had Leopard then, that I suppose can handle less memory than Snow leopard. Today we have 4GB modules, so can I put two 4GB modules and make it 8GB? thanks.

    Read the article

  • ????Oracle EBS R12 on Exadata V2 ,MMA and Hight Performance

    - by longchun.zhu
    ???????? ?????,???, ????????hands-on ??? ??????: 1. Oracle EBS R12 on Database Machine MAA & Performance Architecture. 2. Oracle EBS R12 Single Instance Node Deployment Procedure. 2.Start Rapid Install Wizard. 3. Oracle EBS R12 Single Instance Node Chinese Patch Update. 4.Applying Patches. 5.Upgrade Application Database Version to 11g Release 2. 6.Database Upgrade 7. Deploy Clone Application Database to Sun Oracle Database Machine. 8.Migrate Application Database File System to Exadata ASM Storage. 9.Covert Application Database Single Instance to RAC.. 10.Configure High Availability & High Performance Architecture with Exadata.

    Read the article

  • Canonicalization (On Page Optimization of Duplicate Contents)

    In this article we have discussed about the process of canonicalization that was officially announced by search engines last year to optimize website to avoid indexing of duplicate contents. Further we have discussed a scenario with a real life example in which canonicalization can be helpful and then we have seen its syntax and usage.

    Read the article

  • iPhone SDK Zoom and refresh PDF with Quartz

    - by Ben
    Looking at the QuartzDemo sample application, I love the speed of the PDF rending using quartz alone (that is, without using uiwebview). However, when I'm zooming in the PDF it doesn't seem to become more clear like it does in PDF view. Is there something that I can change to have the same effect when zooming in and out using multitouch? like manipulate the PDF transformation matrix or something? Thanks a bunch. --Ben

    Read the article

  • python list directory , subdirectory and files

    - by thomytheyon
    Hi Alls, I'm trying to make a script to list all directory, subdirectory, and files in a given directory. I tried this : import sys,os root="/home/patate/directory/" path=os.path.join(root,"targetdirectory") for r,d,f in os.walk(path): for file in f: print os.path.join(root,file) Unfortunatly it doesn't work properly, i get all the files, but not them complete path. like : if the dir struct would be : /home/patate/directory/targetdirectory/123/456/789/file.txt It would print: /home/patate/directory/targetdirectory/file.txt What i need is the first result, any help would be greatly appreciated ! Thanks

    Read the article

  • Question about creating digital signature using OpenSSL?(pkcs7)

    - by dangtuantu2002
    I'm using OpenSSL to create digital signature fo my application but I'm getting one problem. BIO *in = NULL, *out = NULL, *tbio = NULL; X509 *scert = NULL; EVP_PKEY *skey = NULL; PKCS7 *p7 = NULL; .......................... .......................... **p7 = PKCS7_sign(scert, skey, NULL, in, flags);** I don't know how can we get digital signature from PKCS7 object to put it into specific variable. Could you please help me to resolve this problem? Thank you very much.

    Read the article

  • Why does mmap() fail with ENOMEM on a 1TB sparse file?

    - by metadaddy
    I've been working with large sparse files on openSUSE 11.2 x86_64. When I try to mmap() a 1TB sparse file, it fails with ENOMEM. I would have thought that the 64 bit address space would be adequate to map in a terabyte, but it seems not. Experimenting further, a 1GB file works fine, but a 2GB file (and anything bigger) fails. I'm guessing there might be a setting somewhere to tweak, but an extensive search turns up nothing. Here's some sample code that shows the problem - any clues? #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h> int main(int argc, char *argv[]) { char * filename = argv[1]; int fd; off_t size = 1UL << 40; // 30 == 1GB, 40 == 1TB fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0666); ftruncate(fd, size); printf("Created %ld byte sparse file\n", size); char * buffer = (char *)mmap(NULL, (size_t)size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if ( buffer == MAP_FAILED ) { perror("mmap"); exit(1); } printf("Done mmap - returned 0x0%lx\n", (unsigned long)buffer); strcpy( buffer, "cafebabe" ); printf("Wrote to start\n"); strcpy( buffer + (size - 9), "deadbeef" ); printf("Wrote to end\n"); if ( munmap(buffer, (size_t)size) < 0 ) { perror("munmap"); exit(1); } close(fd); return 0; }

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >